2 * Copyright (c) 2005-2009 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.
21 #include "fcs_lport.h"
22 #include "fcs_rport.h"
23 #include "fcs_trcmod.h"
25 #include "lport_priv.h"
27 BFA_TRC_FILE(FCS, MS);
29 #define BFA_FCS_MS_CMD_MAX_RETRIES 2
31 * forward declarations
33 static void bfa_fcs_port_ms_send_plogi(void *ms_cbarg,
34 struct bfa_fcxp_s *fcxp_alloced);
35 static void bfa_fcs_port_ms_timeout(void *arg);
36 static void bfa_fcs_port_ms_plogi_response(void *fcsarg,
37 struct bfa_fcxp_s *fcxp,
39 bfa_status_t req_status,
42 struct fchs_s *rsp_fchs);
44 static void bfa_fcs_port_ms_send_gmal(void *ms_cbarg,
45 struct bfa_fcxp_s *fcxp_alloced);
46 static void bfa_fcs_port_ms_gmal_response(void *fcsarg,
47 struct bfa_fcxp_s *fcxp,
49 bfa_status_t req_status,
52 struct fchs_s *rsp_fchs);
53 static void bfa_fcs_port_ms_send_gfn(void *ms_cbarg,
54 struct bfa_fcxp_s *fcxp_alloced);
55 static void bfa_fcs_port_ms_gfn_response(void *fcsarg,
56 struct bfa_fcxp_s *fcxp,
58 bfa_status_t req_status,
61 struct fchs_s *rsp_fchs);
63 * fcs_ms_sm FCS MS state machine
67 * MS State Machine events
70 MSSM_EVENT_PORT_ONLINE = 1,
71 MSSM_EVENT_PORT_OFFLINE = 2,
72 MSSM_EVENT_RSP_OK = 3,
73 MSSM_EVENT_RSP_ERROR = 4,
74 MSSM_EVENT_TIMEOUT = 5,
75 MSSM_EVENT_FCXP_SENT = 6,
76 MSSM_EVENT_PORT_FABRIC_RSCN = 7
79 static void bfa_fcs_port_ms_sm_offline(struct bfa_fcs_port_ms_s *ms,
80 enum port_ms_event event);
81 static void bfa_fcs_port_ms_sm_plogi_sending(struct bfa_fcs_port_ms_s *ms,
82 enum port_ms_event event);
83 static void bfa_fcs_port_ms_sm_plogi(struct bfa_fcs_port_ms_s *ms,
84 enum port_ms_event event);
85 static void bfa_fcs_port_ms_sm_plogi_retry(struct bfa_fcs_port_ms_s *ms,
86 enum port_ms_event event);
87 static void bfa_fcs_port_ms_sm_gmal_sending(struct bfa_fcs_port_ms_s *ms,
88 enum port_ms_event event);
89 static void bfa_fcs_port_ms_sm_gmal(struct bfa_fcs_port_ms_s *ms,
90 enum port_ms_event event);
91 static void bfa_fcs_port_ms_sm_gmal_retry(struct bfa_fcs_port_ms_s *ms,
92 enum port_ms_event event);
93 static void bfa_fcs_port_ms_sm_gfn_sending(struct bfa_fcs_port_ms_s *ms,
94 enum port_ms_event event);
95 static void bfa_fcs_port_ms_sm_gfn(struct bfa_fcs_port_ms_s *ms,
96 enum port_ms_event event);
97 static void bfa_fcs_port_ms_sm_gfn_retry(struct bfa_fcs_port_ms_s *ms,
98 enum port_ms_event event);
99 static void bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
100 enum port_ms_event event);
102 * Start in offline state - awaiting NS to send start.
105 bfa_fcs_port_ms_sm_offline(struct bfa_fcs_port_ms_s *ms,
106 enum port_ms_event event)
108 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
109 bfa_trc(ms->port->fcs, event);
112 case MSSM_EVENT_PORT_ONLINE:
113 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_sending);
114 bfa_fcs_port_ms_send_plogi(ms, NULL);
117 case MSSM_EVENT_PORT_OFFLINE:
121 bfa_sm_fault(ms->port->fcs, event);
126 bfa_fcs_port_ms_sm_plogi_sending(struct bfa_fcs_port_ms_s *ms,
127 enum port_ms_event event)
129 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
130 bfa_trc(ms->port->fcs, event);
133 case MSSM_EVENT_FCXP_SENT:
134 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi);
137 case MSSM_EVENT_PORT_OFFLINE:
138 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
139 bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
144 bfa_sm_fault(ms->port->fcs, event);
149 bfa_fcs_port_ms_sm_plogi(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
151 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
152 bfa_trc(ms->port->fcs, event);
155 case MSSM_EVENT_RSP_ERROR:
157 * Start timer for a delayed retry
159 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_retry);
160 ms->port->stats.ms_retries++;
161 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), &ms->timer,
162 bfa_fcs_port_ms_timeout, ms,
163 BFA_FCS_RETRY_TIMEOUT);
166 case MSSM_EVENT_RSP_OK:
168 * since plogi is done, now invoke MS related sub-modules
170 bfa_fcs_port_fdmi_online(ms);
173 * if this is a Vport, go to online state.
175 if (ms->port->vport) {
176 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
181 * For a base port we need to get the
182 * switch's IP address.
184 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_sending);
185 bfa_fcs_port_ms_send_gmal(ms, NULL);
188 case MSSM_EVENT_PORT_OFFLINE:
189 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
190 bfa_fcxp_discard(ms->fcxp);
194 bfa_sm_fault(ms->port->fcs, event);
199 bfa_fcs_port_ms_sm_plogi_retry(struct bfa_fcs_port_ms_s *ms,
200 enum port_ms_event event)
202 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
203 bfa_trc(ms->port->fcs, event);
206 case MSSM_EVENT_TIMEOUT:
208 * Retry Timer Expired. Re-send
210 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_sending);
211 bfa_fcs_port_ms_send_plogi(ms, NULL);
214 case MSSM_EVENT_PORT_OFFLINE:
215 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
216 bfa_timer_stop(&ms->timer);
220 bfa_sm_fault(ms->port->fcs, event);
225 bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
226 enum port_ms_event event)
228 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
229 bfa_trc(ms->port->fcs, event);
232 case MSSM_EVENT_PORT_OFFLINE:
233 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
236 case MSSM_EVENT_PORT_FABRIC_RSCN:
237 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
239 bfa_fcs_port_ms_send_gfn(ms, NULL);
243 bfa_sm_fault(ms->port->fcs, event);
248 bfa_fcs_port_ms_sm_gmal_sending(struct bfa_fcs_port_ms_s *ms,
249 enum port_ms_event event)
251 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
252 bfa_trc(ms->port->fcs, event);
255 case MSSM_EVENT_FCXP_SENT:
256 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal);
259 case MSSM_EVENT_PORT_OFFLINE:
260 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
261 bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
266 bfa_sm_fault(ms->port->fcs, event);
271 bfa_fcs_port_ms_sm_gmal(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
273 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
274 bfa_trc(ms->port->fcs, event);
277 case MSSM_EVENT_RSP_ERROR:
279 * Start timer for a delayed retry
281 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
282 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_retry);
283 ms->port->stats.ms_retries++;
284 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
285 &ms->timer, bfa_fcs_port_ms_timeout, ms,
286 BFA_FCS_RETRY_TIMEOUT);
288 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
289 bfa_fcs_port_ms_send_gfn(ms, NULL);
294 case MSSM_EVENT_RSP_OK:
295 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
296 bfa_fcs_port_ms_send_gfn(ms, NULL);
299 case MSSM_EVENT_PORT_OFFLINE:
300 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
301 bfa_fcxp_discard(ms->fcxp);
305 bfa_sm_fault(ms->port->fcs, event);
310 bfa_fcs_port_ms_sm_gmal_retry(struct bfa_fcs_port_ms_s *ms,
311 enum port_ms_event event)
313 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
314 bfa_trc(ms->port->fcs, event);
317 case MSSM_EVENT_TIMEOUT:
319 * Retry Timer Expired. Re-send
321 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_sending);
322 bfa_fcs_port_ms_send_gmal(ms, NULL);
325 case MSSM_EVENT_PORT_OFFLINE:
326 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
327 bfa_timer_stop(&ms->timer);
331 bfa_sm_fault(ms->port->fcs, event);
336 * ms_pvt MS local functions
340 bfa_fcs_port_ms_send_gmal(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
342 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
343 struct bfa_fcs_port_s *port = ms->port;
346 struct bfa_fcxp_s *fcxp;
348 bfa_trc(port->fcs, port->pid);
350 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
352 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
353 bfa_fcs_port_ms_send_gmal, ms);
358 len = fc_gmal_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
359 bfa_fcs_port_get_fcid(port),
360 bfa_lps_get_peer_nwwn(port->fabric->lps));
362 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
363 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_gmal_response,
364 (void *)ms, FC_MAX_PDUSZ, FC_FCCT_TOV);
366 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
370 bfa_fcs_port_ms_gmal_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
371 void *cbarg, bfa_status_t req_status,
372 u32 rsp_len, u32 resid_len,
373 struct fchs_s *rsp_fchs)
375 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
376 struct bfa_fcs_port_s *port = ms->port;
377 struct ct_hdr_s *cthdr = NULL;
378 struct fcgs_gmal_resp_s *gmal_resp;
379 struct fc_gmal_entry_s *gmal_entry;
383 bfa_trc(port->fcs, req_status);
384 bfa_trc(port->fcs, port->port_cfg.pwwn);
389 if (req_status != BFA_STATUS_OK) {
390 bfa_trc(port->fcs, req_status);
391 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
395 cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
396 cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
398 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
399 gmal_resp = (struct fcgs_gmal_resp_s *)(cthdr + 1);
400 num_entries = bfa_os_ntohl(gmal_resp->ms_len);
401 if (num_entries == 0) {
402 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
406 * The response could contain multiple Entries.
407 * Entries for SNMP interface, etc.
408 * We look for the entry with a telnet prefix.
409 * First "http://" entry refers to IP addr
412 gmal_entry = (struct fc_gmal_entry_s *)gmal_resp->ms_ma;
413 while (num_entries > 0) {
415 (gmal_entry->prefix, CT_GMAL_RESP_PREFIX_HTTP,
416 sizeof(gmal_entry->prefix)) == 0) {
419 * if the IP address is terminating with a '/',
420 * remove it. *Byte 0 consists of the length
423 rsp_str = &(gmal_entry->prefix[0]);
424 if (rsp_str[gmal_entry->len - 1] == '/')
425 rsp_str[gmal_entry->len - 1] = 0;
427 * copy IP Address to fabric
429 strncpy(bfa_fcs_port_get_fabric_ipaddr(port),
431 BFA_FCS_FABRIC_IPADDR_SZ);
439 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
443 bfa_trc(port->fcs, cthdr->reason_code);
444 bfa_trc(port->fcs, cthdr->exp_code);
445 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
449 bfa_fcs_port_ms_sm_gfn_sending(struct bfa_fcs_port_ms_s *ms,
450 enum port_ms_event event)
452 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
453 bfa_trc(ms->port->fcs, event);
456 case MSSM_EVENT_FCXP_SENT:
457 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn);
460 case MSSM_EVENT_PORT_OFFLINE:
461 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
462 bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
467 bfa_sm_fault(ms->port->fcs, event);
472 bfa_fcs_port_ms_sm_gfn(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
474 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
475 bfa_trc(ms->port->fcs, event);
478 case MSSM_EVENT_RSP_ERROR:
480 * Start timer for a delayed retry
482 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
483 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_retry);
484 ms->port->stats.ms_retries++;
485 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
486 &ms->timer, bfa_fcs_port_ms_timeout, ms,
487 BFA_FCS_RETRY_TIMEOUT);
489 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
494 case MSSM_EVENT_RSP_OK:
495 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
498 case MSSM_EVENT_PORT_OFFLINE:
499 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
500 bfa_fcxp_discard(ms->fcxp);
504 bfa_sm_fault(ms->port->fcs, event);
509 bfa_fcs_port_ms_sm_gfn_retry(struct bfa_fcs_port_ms_s *ms,
510 enum port_ms_event event)
512 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
513 bfa_trc(ms->port->fcs, event);
516 case MSSM_EVENT_TIMEOUT:
518 * Retry Timer Expired. Re-send
520 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
521 bfa_fcs_port_ms_send_gfn(ms, NULL);
524 case MSSM_EVENT_PORT_OFFLINE:
525 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
526 bfa_timer_stop(&ms->timer);
530 bfa_sm_fault(ms->port->fcs, event);
535 * ms_pvt MS local functions
539 bfa_fcs_port_ms_send_gfn(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
541 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
542 struct bfa_fcs_port_s *port = ms->port;
545 struct bfa_fcxp_s *fcxp;
547 bfa_trc(port->fcs, port->pid);
549 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
551 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
552 bfa_fcs_port_ms_send_gfn, ms);
557 len = fc_gfn_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
558 bfa_fcs_port_get_fcid(port),
559 bfa_lps_get_peer_nwwn(port->fabric->lps));
561 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
562 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_gfn_response,
563 (void *)ms, FC_MAX_PDUSZ, FC_FCCT_TOV);
565 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
569 bfa_fcs_port_ms_gfn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
570 bfa_status_t req_status, u32 rsp_len,
571 u32 resid_len, struct fchs_s *rsp_fchs)
573 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
574 struct bfa_fcs_port_s *port = ms->port;
575 struct ct_hdr_s *cthdr = NULL;
578 bfa_trc(port->fcs, req_status);
579 bfa_trc(port->fcs, port->port_cfg.pwwn);
584 if (req_status != BFA_STATUS_OK) {
585 bfa_trc(port->fcs, req_status);
586 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
590 cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
591 cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
593 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
594 gfn_resp = (wwn_t *) (cthdr + 1);
596 * check if it has actually changed
599 ((void *)&bfa_fcs_port_get_fabric_name(port), gfn_resp,
600 sizeof(wwn_t)) != 0))
601 bfa_fcs_fabric_set_fabric_name(port->fabric, *gfn_resp);
602 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
606 bfa_trc(port->fcs, cthdr->reason_code);
607 bfa_trc(port->fcs, cthdr->exp_code);
608 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
612 * ms_pvt MS local functions
616 bfa_fcs_port_ms_send_plogi(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
618 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
619 struct bfa_fcs_port_s *port = ms->port;
622 struct bfa_fcxp_s *fcxp;
624 bfa_trc(port->fcs, port->pid);
626 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
628 port->stats.ms_plogi_alloc_wait++;
629 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
630 bfa_fcs_port_ms_send_plogi, ms);
635 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
636 bfa_os_hton3b(FC_MGMT_SERVER),
637 bfa_fcs_port_get_fcid(port), 0,
638 port->port_cfg.pwwn, port->port_cfg.nwwn,
639 bfa_fcport_get_maxfrsize(port->fcs->bfa));
641 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
642 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_plogi_response,
643 (void *)ms, FC_MAX_PDUSZ, FC_ELS_TOV);
645 port->stats.ms_plogi_sent++;
646 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
650 bfa_fcs_port_ms_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
651 void *cbarg, bfa_status_t req_status,
652 u32 rsp_len, u32 resid_len,
653 struct fchs_s *rsp_fchs)
655 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
657 struct bfa_fcs_port_s *port = ms->port;
658 struct fc_els_cmd_s *els_cmd;
659 struct fc_ls_rjt_s *ls_rjt;
661 bfa_trc(port->fcs, req_status);
662 bfa_trc(port->fcs, port->port_cfg.pwwn);
667 if (req_status != BFA_STATUS_OK) {
668 port->stats.ms_plogi_rsp_err++;
669 bfa_trc(port->fcs, req_status);
670 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
674 els_cmd = (struct fc_els_cmd_s *) BFA_FCXP_RSP_PLD(fcxp);
676 switch (els_cmd->els_code) {
679 if (rsp_len < sizeof(struct fc_logi_s)) {
680 bfa_trc(port->fcs, rsp_len);
681 port->stats.ms_plogi_acc_err++;
682 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
685 port->stats.ms_plogi_accepts++;
686 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
690 ls_rjt = (struct fc_ls_rjt_s *) BFA_FCXP_RSP_PLD(fcxp);
692 bfa_trc(port->fcs, ls_rjt->reason_code);
693 bfa_trc(port->fcs, ls_rjt->reason_code_expl);
695 port->stats.ms_rejects++;
696 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
700 port->stats.ms_plogi_unknown_rsp++;
701 bfa_trc(port->fcs, els_cmd->els_code);
702 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
707 bfa_fcs_port_ms_timeout(void *arg)
709 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)arg;
711 ms->port->stats.ms_timeouts++;
712 bfa_sm_send_event(ms, MSSM_EVENT_TIMEOUT);
717 bfa_fcs_port_ms_init(struct bfa_fcs_port_s *port)
719 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
722 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
725 * Invoke init routines of sub modules.
727 bfa_fcs_port_fdmi_init(ms);
731 bfa_fcs_port_ms_offline(struct bfa_fcs_port_s *port)
733 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
736 bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE);
737 bfa_fcs_port_fdmi_offline(ms);
741 bfa_fcs_port_ms_online(struct bfa_fcs_port_s *port)
743 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
746 bfa_sm_send_event(ms, MSSM_EVENT_PORT_ONLINE);
750 bfa_fcs_port_ms_fabric_rscn(struct bfa_fcs_port_s *port)
752 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
755 * @todo. Handle this only when in Online state
757 if (bfa_sm_cmp_state(ms, bfa_fcs_port_ms_sm_online))
758 bfa_sm_send_event(ms, MSSM_EVENT_PORT_FABRIC_RSCN);