diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcs.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.h | 66 |
1 files changed, 53 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index 51c9e1345719..6c4377cb287f 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 | ||
69 | struct bfa_fcs_lport_ns_s { | 69 | struct 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 | ||
287 | bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port); | 291 | bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port); |
288 | struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs); | 292 | struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs); |
289 | void bfa_fcs_lport_get_rports(struct bfa_fcs_lport_s *port, | 293 | void 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 | |||
292 | wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, | 295 | wwn_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, | |||
324 | void bfa_fcs_lport_online(struct bfa_fcs_lport_s *port); | 327 | void bfa_fcs_lport_online(struct bfa_fcs_lport_s *port); |
325 | void bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port); | 328 | void bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port); |
326 | void bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port); | 329 | void bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port); |
330 | void bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port); | ||
327 | struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid( | 331 | struct 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); |
333 | struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid( | ||
334 | struct bfa_fcs_lport_s *port, u32 pid); | ||
329 | struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn( | 335 | struct 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); |
331 | struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn( | 337 | struct 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); |
339 | struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier( | ||
340 | struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid); | ||
333 | void bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port, | 341 | void 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); |
335 | void bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port, | 343 | void 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); | |||
338 | void bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport); | 346 | void bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport); |
339 | void bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport); | 347 | void bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport); |
340 | void bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port); | 348 | void bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port); |
349 | void bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, | ||
350 | struct bfa_fcxp_s *fcxp_alloced); | ||
341 | void bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport); | 351 | void bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport); |
342 | void bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport); | 352 | void bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport); |
343 | void bfa_fcs_lport_scn_online(struct bfa_fcs_lport_s *vport); | 353 | void 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); | |||
382 | void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport); | 392 | void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport); |
383 | void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport); | 393 | void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport); |
384 | void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport); | 394 | void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport); |
395 | void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport); | ||
385 | void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport); | 396 | void 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, | |||
459 | struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn( | 471 | struct 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); |
461 | void bfa_fcs_rport_set_del_timeout(u8 rport_tmo); | 473 | void bfa_fcs_rport_set_del_timeout(u8 rport_tmo); |
462 | 474 | void bfa_fcs_rport_set_max_logins(u32 max_logins); | |
463 | void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, | 475 | void 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); |
465 | void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport); | 477 | void 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 | ||
515 | static inline struct bfad_port_s * | 528 | static inline struct bfad_port_s * |
516 | bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim) | 529 | bfa_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, | |||
592 | struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport); | 605 | struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport); |
593 | void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim); | 606 | void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim); |
594 | void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim); | 607 | void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim); |
595 | void bfa_fcs_itnim_rport_online(struct bfa_fcs_itnim_s *itnim); | 608 | void bfa_fcs_itnim_brp_online(struct bfa_fcs_itnim_s *itnim); |
596 | bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim); | 609 | bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim); |
597 | void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim); | 610 | void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim); |
598 | void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, | 611 | void 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 | */ | ||
753 | enum 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); | |||
741 | void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, | 778 | void 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); |
743 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); | 780 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); |
781 | void 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); | |||
766 | void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, | 804 | void 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); |
768 | void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); | 806 | void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); |
807 | void bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric); | ||
769 | void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, | 808 | void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, |
770 | wwn_t fabric_name); | 809 | wwn_t fabric_name); |
771 | u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); | 810 | u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); |
772 | void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); | 811 | void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); |
773 | void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); | 812 | void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); |
813 | void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs); | ||
774 | void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | 814 | void 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); |
776 | void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, | 816 | void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, |