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 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), &ms->timer,
161 bfa_fcs_port_ms_timeout, ms,
162 BFA_FCS_RETRY_TIMEOUT);
165 case MSSM_EVENT_RSP_OK:
167 * since plogi is done, now invoke MS related sub-modules
169 bfa_fcs_port_fdmi_online(ms);
172 * if this is a Vport, go to online state.
174 if (ms->port->vport) {
175 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
180 * For a base port we need to get the
181 * switch's IP address.
183 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_sending);
184 bfa_fcs_port_ms_send_gmal(ms, NULL);
187 case MSSM_EVENT_PORT_OFFLINE:
188 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
189 bfa_fcxp_discard(ms->fcxp);
193 bfa_sm_fault(ms->port->fcs, event);
198 bfa_fcs_port_ms_sm_plogi_retry(struct bfa_fcs_port_ms_s *ms,
199 enum port_ms_event event)
201 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
202 bfa_trc(ms->port->fcs, event);
205 case MSSM_EVENT_TIMEOUT:
207 * Retry Timer Expired. Re-send
209 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_sending);
210 bfa_fcs_port_ms_send_plogi(ms, NULL);
213 case MSSM_EVENT_PORT_OFFLINE:
214 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
215 bfa_timer_stop(&ms->timer);
219 bfa_sm_fault(ms->port->fcs, event);
224 bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
225 enum port_ms_event event)
227 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
228 bfa_trc(ms->port->fcs, event);
231 case MSSM_EVENT_PORT_OFFLINE:
232 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
235 case MSSM_EVENT_PORT_FABRIC_RSCN:
236 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
238 bfa_fcs_port_ms_send_gfn(ms, NULL);
242 bfa_sm_fault(ms->port->fcs, event);
247 bfa_fcs_port_ms_sm_gmal_sending(struct bfa_fcs_port_ms_s *ms,
248 enum port_ms_event event)
250 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
251 bfa_trc(ms->port->fcs, event);
254 case MSSM_EVENT_FCXP_SENT:
255 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal);
258 case MSSM_EVENT_PORT_OFFLINE:
259 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
260 bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
265 bfa_sm_fault(ms->port->fcs, event);
270 bfa_fcs_port_ms_sm_gmal(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
272 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
273 bfa_trc(ms->port->fcs, event);
276 case MSSM_EVENT_RSP_ERROR:
278 * Start timer for a delayed retry
280 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
281 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_retry);
282 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
283 &ms->timer, bfa_fcs_port_ms_timeout, ms,
284 BFA_FCS_RETRY_TIMEOUT);
286 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
287 bfa_fcs_port_ms_send_gfn(ms, NULL);
292 case MSSM_EVENT_RSP_OK:
293 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
294 bfa_fcs_port_ms_send_gfn(ms, NULL);
297 case MSSM_EVENT_PORT_OFFLINE:
298 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
299 bfa_fcxp_discard(ms->fcxp);
303 bfa_sm_fault(ms->port->fcs, event);
308 bfa_fcs_port_ms_sm_gmal_retry(struct bfa_fcs_port_ms_s *ms,
309 enum port_ms_event event)
311 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
312 bfa_trc(ms->port->fcs, event);
315 case MSSM_EVENT_TIMEOUT:
317 * Retry Timer Expired. Re-send
319 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_sending);
320 bfa_fcs_port_ms_send_gmal(ms, NULL);
323 case MSSM_EVENT_PORT_OFFLINE:
324 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
325 bfa_timer_stop(&ms->timer);
329 bfa_sm_fault(ms->port->fcs, event);
334 * ms_pvt MS local functions
338 bfa_fcs_port_ms_send_gmal(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
340 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
341 struct bfa_fcs_port_s *port = ms->port;
344 struct bfa_fcxp_s *fcxp;
346 bfa_trc(port->fcs, port->pid);
348 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
350 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
351 bfa_fcs_port_ms_send_gmal, ms);
356 len = fc_gmal_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
357 bfa_fcs_port_get_fcid(port),
358 bfa_lps_get_peer_nwwn(port->fabric->lps));
360 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
361 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_gmal_response,
362 (void *)ms, FC_MAX_PDUSZ, FC_RA_TOV);
364 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
368 bfa_fcs_port_ms_gmal_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
369 void *cbarg, bfa_status_t req_status,
370 u32 rsp_len, u32 resid_len,
371 struct fchs_s *rsp_fchs)
373 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
374 struct bfa_fcs_port_s *port = ms->port;
375 struct ct_hdr_s *cthdr = NULL;
376 struct fcgs_gmal_resp_s *gmal_resp;
377 struct fc_gmal_entry_s *gmal_entry;
381 bfa_trc(port->fcs, req_status);
382 bfa_trc(port->fcs, port->port_cfg.pwwn);
387 if (req_status != BFA_STATUS_OK) {
388 bfa_trc(port->fcs, req_status);
389 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
393 cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
394 cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
396 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
397 gmal_resp = (struct fcgs_gmal_resp_s *)(cthdr + 1);
398 num_entries = bfa_os_ntohl(gmal_resp->ms_len);
399 if (num_entries == 0) {
400 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
404 * The response could contain multiple Entries.
405 * Entries for SNMP interface, etc.
406 * We look for the entry with a telnet prefix.
407 * First "http://" entry refers to IP addr
410 gmal_entry = (struct fc_gmal_entry_s *)gmal_resp->ms_ma;
411 while (num_entries > 0) {
413 (gmal_entry->prefix, CT_GMAL_RESP_PREFIX_HTTP,
414 sizeof(gmal_entry->prefix)) == 0) {
417 * if the IP address is terminating with a '/',
418 * remove it. *Byte 0 consists of the length
421 rsp_str = &(gmal_entry->prefix[0]);
422 if (rsp_str[gmal_entry->len - 1] == '/')
423 rsp_str[gmal_entry->len - 1] = 0;
425 * copy IP Address to fabric
427 strncpy(bfa_fcs_port_get_fabric_ipaddr(port),
429 BFA_FCS_FABRIC_IPADDR_SZ);
437 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
441 bfa_trc(port->fcs, cthdr->reason_code);
442 bfa_trc(port->fcs, cthdr->exp_code);
443 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
447 bfa_fcs_port_ms_sm_gfn_sending(struct bfa_fcs_port_ms_s *ms,
448 enum port_ms_event event)
450 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
451 bfa_trc(ms->port->fcs, event);
454 case MSSM_EVENT_FCXP_SENT:
455 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn);
458 case MSSM_EVENT_PORT_OFFLINE:
459 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
460 bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
465 bfa_sm_fault(ms->port->fcs, event);
470 bfa_fcs_port_ms_sm_gfn(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
472 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
473 bfa_trc(ms->port->fcs, event);
476 case MSSM_EVENT_RSP_ERROR:
478 * Start timer for a delayed retry
480 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
481 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_retry);
482 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
483 &ms->timer, bfa_fcs_port_ms_timeout, ms,
484 BFA_FCS_RETRY_TIMEOUT);
486 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
491 case MSSM_EVENT_RSP_OK:
492 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_online);
495 case MSSM_EVENT_PORT_OFFLINE:
496 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
497 bfa_fcxp_discard(ms->fcxp);
501 bfa_sm_fault(ms->port->fcs, event);
506 bfa_fcs_port_ms_sm_gfn_retry(struct bfa_fcs_port_ms_s *ms,
507 enum port_ms_event event)
509 bfa_trc(ms->port->fcs, ms->port->port_cfg.pwwn);
510 bfa_trc(ms->port->fcs, event);
513 case MSSM_EVENT_TIMEOUT:
515 * Retry Timer Expired. Re-send
517 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_sending);
518 bfa_fcs_port_ms_send_gfn(ms, NULL);
521 case MSSM_EVENT_PORT_OFFLINE:
522 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
523 bfa_timer_stop(&ms->timer);
527 bfa_sm_fault(ms->port->fcs, event);
532 * ms_pvt MS local functions
536 bfa_fcs_port_ms_send_gfn(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
538 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
539 struct bfa_fcs_port_s *port = ms->port;
542 struct bfa_fcxp_s *fcxp;
544 bfa_trc(port->fcs, port->pid);
546 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
548 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
549 bfa_fcs_port_ms_send_gfn, ms);
554 len = fc_gfn_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
555 bfa_fcs_port_get_fcid(port),
556 bfa_lps_get_peer_nwwn(port->fabric->lps));
558 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
559 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_gfn_response,
560 (void *)ms, FC_MAX_PDUSZ, FC_RA_TOV);
562 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
566 bfa_fcs_port_ms_gfn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
567 bfa_status_t req_status, u32 rsp_len,
568 u32 resid_len, struct fchs_s *rsp_fchs)
570 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
571 struct bfa_fcs_port_s *port = ms->port;
572 struct ct_hdr_s *cthdr = NULL;
575 bfa_trc(port->fcs, req_status);
576 bfa_trc(port->fcs, port->port_cfg.pwwn);
581 if (req_status != BFA_STATUS_OK) {
582 bfa_trc(port->fcs, req_status);
583 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
587 cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
588 cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
590 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
591 gfn_resp = (wwn_t *) (cthdr + 1);
593 * check if it has actually changed
596 ((void *)&bfa_fcs_port_get_fabric_name(port), gfn_resp,
597 sizeof(wwn_t)) != 0))
598 bfa_fcs_fabric_set_fabric_name(port->fabric, *gfn_resp);
599 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
603 bfa_trc(port->fcs, cthdr->reason_code);
604 bfa_trc(port->fcs, cthdr->exp_code);
605 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
609 * ms_pvt MS local functions
613 bfa_fcs_port_ms_send_plogi(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
615 struct bfa_fcs_port_ms_s *ms = ms_cbarg;
616 struct bfa_fcs_port_s *port = ms->port;
619 struct bfa_fcxp_s *fcxp;
621 bfa_trc(port->fcs, port->pid);
623 fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
625 port->stats.ms_plogi_alloc_wait++;
626 bfa_fcxp_alloc_wait(port->fcs->bfa, &ms->fcxp_wqe,
627 bfa_fcs_port_ms_send_plogi, ms);
632 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
633 bfa_os_hton3b(FC_MGMT_SERVER),
634 bfa_fcs_port_get_fcid(port), 0,
635 port->port_cfg.pwwn, port->port_cfg.nwwn,
636 bfa_fcport_get_maxfrsize(port->fcs->bfa));
638 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
639 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_plogi_response,
640 (void *)ms, FC_MAX_PDUSZ, FC_RA_TOV);
642 port->stats.ms_plogi_sent++;
643 bfa_sm_send_event(ms, MSSM_EVENT_FCXP_SENT);
647 bfa_fcs_port_ms_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
648 void *cbarg, bfa_status_t req_status,
649 u32 rsp_len, u32 resid_len,
650 struct fchs_s *rsp_fchs)
652 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg;
654 struct bfa_fcs_port_s *port = ms->port;
655 struct fc_els_cmd_s *els_cmd;
656 struct fc_ls_rjt_s *ls_rjt;
658 bfa_trc(port->fcs, req_status);
659 bfa_trc(port->fcs, port->port_cfg.pwwn);
664 if (req_status != BFA_STATUS_OK) {
665 port->stats.ms_plogi_rsp_err++;
666 bfa_trc(port->fcs, req_status);
667 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
671 els_cmd = (struct fc_els_cmd_s *) BFA_FCXP_RSP_PLD(fcxp);
673 switch (els_cmd->els_code) {
676 if (rsp_len < sizeof(struct fc_logi_s)) {
677 bfa_trc(port->fcs, rsp_len);
678 port->stats.ms_plogi_acc_err++;
679 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
682 port->stats.ms_plogi_accepts++;
683 bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK);
687 ls_rjt = (struct fc_ls_rjt_s *) BFA_FCXP_RSP_PLD(fcxp);
689 bfa_trc(port->fcs, ls_rjt->reason_code);
690 bfa_trc(port->fcs, ls_rjt->reason_code_expl);
692 port->stats.ms_rejects++;
693 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
697 port->stats.ms_plogi_unknown_rsp++;
698 bfa_trc(port->fcs, els_cmd->els_code);
699 bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR);
704 bfa_fcs_port_ms_timeout(void *arg)
706 struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)arg;
708 ms->port->stats.ms_timeouts++;
709 bfa_sm_send_event(ms, MSSM_EVENT_TIMEOUT);
714 bfa_fcs_port_ms_init(struct bfa_fcs_port_s *port)
716 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
719 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
722 * Invoke init routines of sub modules.
724 bfa_fcs_port_fdmi_init(ms);
728 bfa_fcs_port_ms_offline(struct bfa_fcs_port_s *port)
730 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
733 bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE);
734 bfa_fcs_port_fdmi_offline(ms);
738 bfa_fcs_port_ms_online(struct bfa_fcs_port_s *port)
740 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
743 bfa_sm_send_event(ms, MSSM_EVENT_PORT_ONLINE);
747 bfa_fcs_port_ms_fabric_rscn(struct bfa_fcs_port_s *port)
749 struct bfa_fcs_port_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
752 * @todo. Handle this only when in Online state
754 if (bfa_sm_cmp_state(ms, bfa_fcs_port_ms_sm_online))
755 bfa_sm_send_event(ms, MSSM_EVENT_PORT_FABRIC_RSCN);