aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcs.h')
-rw-r--r--drivers/scsi/bfa/bfa_fcs.h66
1 files changed, 53 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 51c9e134571..6c4377cb287 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -62,9 +62,9 @@ struct bfa_fcs_s;
62#define N2N_LOCAL_PID 0x010000 62#define N2N_LOCAL_PID 0x010000
63#define N2N_REMOTE_PID 0x020000 63#define N2N_REMOTE_PID 0x020000
64#define BFA_FCS_RETRY_TIMEOUT 2000 64#define BFA_FCS_RETRY_TIMEOUT 2000
65#define BFA_FCS_MAX_NS_RETRIES 5
65#define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0) 66#define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0)
66 67#define BFA_FCS_MAX_RPORT_LOGINS 1024
67
68 68
69struct bfa_fcs_lport_ns_s { 69struct bfa_fcs_lport_ns_s {
70 bfa_sm_t sm; /* state machine */ 70 bfa_sm_t sm; /* state machine */
@@ -72,6 +72,8 @@ struct bfa_fcs_lport_ns_s {
72 struct bfa_fcs_lport_s *port; /* parent port */ 72 struct bfa_fcs_lport_s *port; /* parent port */
73 struct bfa_fcxp_s *fcxp; 73 struct bfa_fcxp_s *fcxp;
74 struct bfa_fcxp_wqe_s fcxp_wqe; 74 struct bfa_fcxp_wqe_s fcxp_wqe;
75 u8 num_rnnid_retries;
76 u8 num_rsnn_nn_retries;
75}; 77};
76 78
77 79
@@ -205,6 +207,7 @@ struct bfa_fcs_fabric_s {
205 struct bfa_lps_s *lps; /* lport login services */ 207 struct bfa_lps_s *lps; /* lport login services */
206 u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ]; 208 u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ];
207 /* attached fabric's ip addr */ 209 /* attached fabric's ip addr */
210 struct bfa_wc_s stop_wc; /* wait counter for stop */
208}; 211};
209 212
210#define bfa_fcs_fabric_npiv_capable(__f) ((__f)->is_npiv) 213#define bfa_fcs_fabric_npiv_capable(__f) ((__f)->is_npiv)
@@ -264,6 +267,7 @@ struct bfa_fcs_fabric_s;
264#define bfa_fcs_lport_get_pwwn(_lport) ((_lport)->port_cfg.pwwn) 267#define bfa_fcs_lport_get_pwwn(_lport) ((_lport)->port_cfg.pwwn)
265#define bfa_fcs_lport_get_nwwn(_lport) ((_lport)->port_cfg.nwwn) 268#define bfa_fcs_lport_get_nwwn(_lport) ((_lport)->port_cfg.nwwn)
266#define bfa_fcs_lport_get_psym_name(_lport) ((_lport)->port_cfg.sym_name) 269#define bfa_fcs_lport_get_psym_name(_lport) ((_lport)->port_cfg.sym_name)
270#define bfa_fcs_lport_get_nsym_name(_lport) ((_lport)->port_cfg.node_sym_name)
267#define bfa_fcs_lport_is_initiator(_lport) \ 271#define bfa_fcs_lport_is_initiator(_lport) \
268 ((_lport)->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM) 272 ((_lport)->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
269#define bfa_fcs_lport_get_nrports(_lport) \ 273#define bfa_fcs_lport_get_nrports(_lport) \
@@ -286,9 +290,8 @@ bfa_fcs_lport_get_drvport(struct bfa_fcs_lport_s *port)
286 290
287bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port); 291bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port);
288struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs); 292struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs);
289void bfa_fcs_lport_get_rports(struct bfa_fcs_lport_s *port, 293void bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
290 wwn_t rport_wwns[], int *nrports); 294 struct bfa_rport_qualifier_s rport[], int *nrports);
291
292wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, 295wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn,
293 int index, int nrports, bfa_boolean_t bwwn); 296 int index, int nrports, bfa_boolean_t bwwn);
294 297
@@ -324,12 +327,17 @@ void bfa_fcs_lport_init(struct bfa_fcs_lport_s *lport,
324void bfa_fcs_lport_online(struct bfa_fcs_lport_s *port); 327void bfa_fcs_lport_online(struct bfa_fcs_lport_s *port);
325void bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port); 328void bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port);
326void bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port); 329void bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
330void bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
327struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid( 331struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid(
328 struct bfa_fcs_lport_s *port, u32 pid); 332 struct bfa_fcs_lport_s *port, u32 pid);
333struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
334 struct bfa_fcs_lport_s *port, u32 pid);
329struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn( 335struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
330 struct bfa_fcs_lport_s *port, wwn_t pwwn); 336 struct bfa_fcs_lport_s *port, wwn_t pwwn);
331struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn( 337struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
332 struct bfa_fcs_lport_s *port, wwn_t nwwn); 338 struct bfa_fcs_lport_s *port, wwn_t nwwn);
339struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier(
340 struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid);
333void bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port, 341void bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
334 struct bfa_fcs_rport_s *rport); 342 struct bfa_fcs_rport_s *rport);
335void bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port, 343void bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port,
@@ -338,6 +346,8 @@ void bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *vport);
338void bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport); 346void bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport);
339void bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport); 347void bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport);
340void bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port); 348void bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port);
349void bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
350 struct bfa_fcxp_s *fcxp_alloced);
341void bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport); 351void bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport);
342void bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport); 352void bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport);
343void bfa_fcs_lport_scn_online(struct bfa_fcs_lport_s *vport); 353void bfa_fcs_lport_scn_online(struct bfa_fcs_lport_s *vport);
@@ -382,6 +392,7 @@ void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
382void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport); 392void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
383void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport); 393void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
384void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport); 394void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
395void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport);
385void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport); 396void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
386 397
387#define BFA_FCS_RPORT_DEF_DEL_TIMEOUT 90 /* in secs */ 398#define BFA_FCS_RPORT_DEF_DEL_TIMEOUT 90 /* in secs */
@@ -419,6 +430,7 @@ struct bfa_fcs_rport_s {
419 struct bfa_fcs_s *fcs; /* fcs instance */ 430 struct bfa_fcs_s *fcs; /* fcs instance */
420 struct bfad_rport_s *rp_drv; /* driver peer instance */ 431 struct bfad_rport_s *rp_drv; /* driver peer instance */
421 u32 pid; /* port ID of rport */ 432 u32 pid; /* port ID of rport */
433 u32 old_pid; /* PID before rport goes offline */
422 u16 maxfrsize; /* maximum frame size */ 434 u16 maxfrsize; /* maximum frame size */
423 __be16 reply_oxid; /* OX_ID of inbound requests */ 435 __be16 reply_oxid; /* OX_ID of inbound requests */
424 enum fc_cos fc_cos; /* FC classes of service supp */ 436 enum fc_cos fc_cos; /* FC classes of service supp */
@@ -459,7 +471,7 @@ struct bfa_fcs_rport_s *bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port,
459struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn( 471struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn(
460 struct bfa_fcs_lport_s *port, wwn_t rnwwn); 472 struct bfa_fcs_lport_s *port, wwn_t rnwwn);
461void bfa_fcs_rport_set_del_timeout(u8 rport_tmo); 473void bfa_fcs_rport_set_del_timeout(u8 rport_tmo);
462 474void bfa_fcs_rport_set_max_logins(u32 max_logins);
463void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, 475void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
464 struct fchs_s *fchs, u16 len); 476 struct fchs_s *fchs, u16 len);
465void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport); 477void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
@@ -505,12 +517,13 @@ struct bfa_fcs_itnim_s {
505 struct bfa_fcxp_s *fcxp; /* FCXP in use */ 517 struct bfa_fcxp_s *fcxp; /* FCXP in use */
506 struct bfa_itnim_stats_s stats; /* itn statistics */ 518 struct bfa_itnim_stats_s stats; /* itn statistics */
507}; 519};
508#define bfa_fcs_fcxp_alloc(__fcs) \ 520#define bfa_fcs_fcxp_alloc(__fcs, __req) \
509 bfa_fcxp_alloc(NULL, (__fcs)->bfa, 0, 0, NULL, NULL, NULL, NULL) 521 bfa_fcxp_req_rsp_alloc(NULL, (__fcs)->bfa, 0, 0, \
510 522 NULL, NULL, NULL, NULL, __req)
511#define bfa_fcs_fcxp_alloc_wait(__bfa, __wqe, __alloc_cbfn, __alloc_cbarg) \ 523#define bfa_fcs_fcxp_alloc_wait(__bfa, __wqe, __alloc_cbfn, \
512 bfa_fcxp_alloc_wait(__bfa, __wqe, __alloc_cbfn, __alloc_cbarg, \ 524 __alloc_cbarg, __req) \
513 NULL, 0, 0, NULL, NULL, NULL, NULL) 525 bfa_fcxp_req_rsp_alloc_wait(__bfa, __wqe, __alloc_cbfn, \
526 __alloc_cbarg, NULL, 0, 0, NULL, NULL, NULL, NULL, __req)
514 527
515static inline struct bfad_port_s * 528static inline struct bfad_port_s *
516bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim) 529bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
@@ -592,7 +605,7 @@ bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port,
592struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport); 605struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport);
593void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim); 606void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim);
594void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim); 607void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim);
595void bfa_fcs_itnim_rport_online(struct bfa_fcs_itnim_s *itnim); 608void bfa_fcs_itnim_brp_online(struct bfa_fcs_itnim_s *itnim);
596bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim); 609bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim);
597void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim); 610void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);
598void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, 611void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
@@ -676,6 +689,7 @@ struct bfa_fcs_s {
676 struct bfa_fcs_stats_s stats; /* FCS statistics */ 689 struct bfa_fcs_stats_s stats; /* FCS statistics */
677 struct bfa_wc_s wc; /* waiting counter */ 690 struct bfa_wc_s wc; /* waiting counter */
678 int fcs_aen_seq; 691 int fcs_aen_seq;
692 u32 num_rport_logins;
679}; 693};
680 694
681/* 695/*
@@ -702,6 +716,9 @@ enum bfa_fcs_fabric_event {
702 BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */ 716 BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */
703 BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */ 717 BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */
704 BFA_FCS_FABRIC_SM_START = 16, /* from driver */ 718 BFA_FCS_FABRIC_SM_START = 16, /* from driver */
719 BFA_FCS_FABRIC_SM_STOP = 17, /* Stop from driver */
720 BFA_FCS_FABRIC_SM_STOPCOMP = 18, /* Stop completion */
721 BFA_FCS_FABRIC_SM_LOGOCOMP = 19, /* FLOGO completion */
705}; 722};
706 723
707/* 724/*
@@ -727,6 +744,26 @@ enum rport_event {
727 RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */ 744 RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */
728 RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */ 745 RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */
729 RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continuously */ 746 RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continuously */
747 RPSM_EVENT_FC4_FCS_ONLINE = 19, /*!< FC-4 FCS online complete */
748};
749
750/*
751 * fcs_itnim_sm FCS itnim state machine events
752 */
753enum bfa_fcs_itnim_event {
754 BFA_FCS_ITNIM_SM_FCS_ONLINE = 1, /* rport online event */
755 BFA_FCS_ITNIM_SM_OFFLINE = 2, /* rport offline */
756 BFA_FCS_ITNIM_SM_FRMSENT = 3, /* prli frame is sent */
757 BFA_FCS_ITNIM_SM_RSP_OK = 4, /* good response */
758 BFA_FCS_ITNIM_SM_RSP_ERROR = 5, /* error response */
759 BFA_FCS_ITNIM_SM_TIMEOUT = 6, /* delay timeout */
760 BFA_FCS_ITNIM_SM_HCB_OFFLINE = 7, /* BFA online callback */
761 BFA_FCS_ITNIM_SM_HCB_ONLINE = 8, /* BFA offline callback */
762 BFA_FCS_ITNIM_SM_INITIATOR = 9, /* rport is initiator */
763 BFA_FCS_ITNIM_SM_DELETE = 10, /* delete event from rport */
764 BFA_FCS_ITNIM_SM_PRLO = 11, /* delete event from rport */
765 BFA_FCS_ITNIM_SM_RSP_NOT_SUPP = 12, /* cmd not supported rsp */
766 BFA_FCS_ITNIM_SM_HAL_ONLINE = 13, /*!< bfa rport online event */
730}; 767};
731 768
732/* 769/*
@@ -741,6 +778,7 @@ void bfa_fcs_update_cfg(struct bfa_fcs_s *fcs);
741void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, 778void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
742 struct bfa_fcs_driver_info_s *driver_info); 779 struct bfa_fcs_driver_info_s *driver_info);
743void bfa_fcs_exit(struct bfa_fcs_s *fcs); 780void bfa_fcs_exit(struct bfa_fcs_s *fcs);
781void bfa_fcs_stop(struct bfa_fcs_s *fcs);
744 782
745/* 783/*
746 * bfa fcs vf public functions 784 * bfa fcs vf public functions
@@ -766,11 +804,13 @@ void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
766void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, 804void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
767 struct fchs_s *fchs, u16 len); 805 struct fchs_s *fchs, u16 len);
768void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); 806void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
807void bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
769void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, 808void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
770 wwn_t fabric_name); 809 wwn_t fabric_name);
771u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); 810u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
772void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); 811void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
773void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); 812void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
813void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
774void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, 814void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
775 enum bfa_fcs_fabric_event event); 815 enum bfa_fcs_fabric_event event);
776void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, 816void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,