bfa: fcs changes part 1
Subsystems (2)
PATCH 5/8 bfa: fcs changes part 1
fcs changes part 1:
- Changes related to port structures renaming.
- Changes to provide separate functions to do attach time FCS initialization and initialization after IOC is up for better firmware upgrade handling.
- Changes related to FDMI prameter initialization.
- Changes to remove ioc_attr local variable from stack.
- Misc style and formatting changes.
Signed-off-by Jing Huang <[email protected]>
--- drivers/scsi/bfa/fabric.c | 294 ++++++++++++++++----------------- drivers/scsi/bfa/fcbuild.c | 124 ++++++-------- drivers/scsi/bfa/fcbuild.h | 299 ++++++++++++++++++++-------------- drivers/scsi/bfa/fcpim.c | 182 +++++++++------------ drivers/scsi/bfa/fcs_fabric.h | 52 +++--- drivers/scsi/bfa/fcs_fcpim.h | 8 +- drivers/scsi/bfa/fcs_fcptm.h | 22 ++-- drivers/scsi/bfa/fcs_lport.h | 38 ++-- drivers/scsi/bfa/fcs_port.h | 3 +- drivers/scsi/bfa/fcs_rport.h | 21 +-- drivers/scsi/bfa/fcs_uf.h | 3 +- drivers/scsi/bfa/fcs_vport.h | 9 - drivers/scsi/bfa/fdmi.c | 364 +++++++++++++++++++++++------------------ drivers/scsi/bfa/loop.c | 23 ++-- drivers/scsi/bfa/lport_api.c | 54 ++++--- 15 files changed, 763 insertions(+), 733 deletions(-)
drivers/scsi/bfa/fabric.c +143 -151
@@ -33,35 +33,36 @@BFA_TRC_FILE (FCS ,FABRIC ); -#define BFA_FCS_FABRIC_RETRY_DELAY (2000)/* Milliseconds */ +#define BFA_FCS_FABRIC_RETRY_DELAY (2000)/* Milliseconds */ #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000)/* Milliseconds */ -#define bfa_fcs_fabric_set_opertype (__fabric) do { \ - if (bfa_pport_get_topology((__fabric)->fcs->bfa) \ - == BFA_PPORT_TOPOLOGY_P2P) \ - (__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \ - else \ - (__fabric)->oper_type = BFA_PPORT_TYPE_NLPORT; \ -} while (0) +#define bfa_fcs_fabric_set_opertype (__fabric) do { \ + if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \ + == BFA_PPORT_TOPOLOGY_P2P) \ + (__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \ + else \ + (__fabric)->oper_type = BFA_PPORT_TYPE_NLPORT; \ + } while (0)/* * forward declarations */ -static void bfa_fcs_fabric_init (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_login (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_notify_online (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_notify_offline (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_delay (void *cbarg); -static void bfa_fcs_fabric_delete (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_delete_comp (void *cbarg); -static void bfa_fcs_fabric_process_uf (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_init (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_login (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_notify_online (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_notify_offline (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_delay (void *cbarg); +static void bfa_fcs_fabric_delete (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_delete_comp (void *cbarg); +static void bfa_fcs_fabric_process_uf (struct bfa_fcs_fabric_s *fabric,struct fchs_s *fchs,u16 len); -static void bfa_fcs_fabric_process_flogi (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_process_flogi (struct bfa_fcs_fabric_s *fabric,struct fchs_s *fchs,u16 len); -static void bfa_fcs_fabric_send_flogi_acc (struct bfa_fcs_fabric_s *fabric); -static void bfa_fcs_fabric_flogiacc_comp (void *fcsarg, +static void bfa_fcs_fabric_send_flogi_acc (struct bfa_fcs_fabric_s *fabric); +static void bfa_fcs_fabric_flogiacc_comp (void *fcsarg,struct bfa_fcxp_s *fcxp, -void *cbarg,bfa_status_t status, +void *cbarg, +bfa_status_t status,u32 rsp_len,u32 resid_len,struct fchs_s *rspfchs);
@@ -73,54 +74,51 @@ static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg,* Fabric state machine events */ enum bfa_fcs_fabric_event { -BFA_FCS_FABRIC_SM_CREATE =1 ,/* fabric create from driver */ -BFA_FCS_FABRIC_SM_DELETE =2 ,/* fabric delete from driver */ -BFA_FCS_FABRIC_SM_LINK_DOWN =3 ,/* link down from port */ -BFA_FCS_FABRIC_SM_LINK_UP =4 ,/* link up from port */ -BFA_FCS_FABRIC_SM_CONT_OP =5 ,/* continue op from flogi/auth */ -BFA_FCS_FABRIC_SM_RETRY_OP =6 ,/* continue op from flogi/auth */ -BFA_FCS_FABRIC_SM_NO_FABRIC =7 ,/* no fabric from flogi/auth -*/ -BFA_FCS_FABRIC_SM_PERF_EVFP =8 ,/* perform EVFP from -*flogi/auth */ -BFA_FCS_FABRIC_SM_ISOLATE =9 ,/* isolate from EVFP processing */ -BFA_FCS_FABRIC_SM_NO_TAGGING =10 ,/* no VFT tagging from EVFP */ -BFA_FCS_FABRIC_SM_DELAYED =11 ,/* timeout delay event */ -BFA_FCS_FABRIC_SM_AUTH_FAILED =12 ,/* authentication failed */ -BFA_FCS_FABRIC_SM_AUTH_SUCCESS =13 ,/* authentication successful -*/ -BFA_FCS_FABRIC_SM_DELCOMP =14 ,/* all vports deleted event */ -BFA_FCS_FABRIC_SM_LOOPBACK =15 ,/* Received our own FLOGI */ -BFA_FCS_FABRIC_SM_START =16 ,/* fabric delete from driver */ +BFA_FCS_FABRIC_SM_CREATE =1 ,/* fabric create from driver */ +BFA_FCS_FABRIC_SM_DELETE =2 ,/* fabric delete from driver */ +BFA_FCS_FABRIC_SM_LINK_DOWN =3 ,/* link down from port */ +BFA_FCS_FABRIC_SM_LINK_UP =4 ,/* link up from port */ +BFA_FCS_FABRIC_SM_CONT_OP =5 ,/* continue op from flogi/auth*/ +BFA_FCS_FABRIC_SM_RETRY_OP =6 ,/* continue op from flogi/auth*/ +BFA_FCS_FABRIC_SM_NO_FABRIC =7 ,/* no fabric from flogi/auth */ +BFA_FCS_FABRIC_SM_PERF_EVFP =8 ,/* perform EVFP from flogi/auth*/ +BFA_FCS_FABRIC_SM_ISOLATE =9 ,/* isolate from EVFP processing*/ +BFA_FCS_FABRIC_SM_NO_TAGGING =10 ,/* no VFT tagging from EVFP */ +BFA_FCS_FABRIC_SM_DELAYED =11 ,/* timeout delay event */ +BFA_FCS_FABRIC_SM_AUTH_FAILED =12 ,/* authentication failed */ +BFA_FCS_FABRIC_SM_AUTH_SUCCESS =13 ,/* authentication successful */ +BFA_FCS_FABRIC_SM_DELCOMP =14 ,/* all vports deleted event */ +BFA_FCS_FABRIC_SM_LOOPBACK =15 ,/* Received our own FLOGI */ +BFA_FCS_FABRIC_SM_START =16 ,/* fabric delete from driver */ }; -static void bfa_fcs_fabric_sm_uninit (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_uninit (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_created (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_created (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_linkdown (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_linkdown (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_flogi (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_flogi (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_flogi_retry (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_flogi_retry (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_auth (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_auth (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_auth_failed (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_auth_failed (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_loopback (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_loopback (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_nofabric (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_nofabric (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_online (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_online (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_evfp (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_evfp (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_evfp_done (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_evfp_done (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_isolated (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_isolated (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event); -static void bfa_fcs_fabric_sm_deleting (struct bfa_fcs_fabric_s *fabric, +static void bfa_fcs_fabric_sm_deleting (struct bfa_fcs_fabric_s *fabric,enum bfa_fcs_fabric_event event);/** * Beginning state before fabric creation.
@@ -136,8 +134,7 @@ bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,case BFA_FCS_FABRIC_SM_CREATE :bfa_sm_set_state (fabric, bfa_fcs_fabric_sm_created);bfa_fcs_fabric_init (fabric); -bfa_fcs_lport_init (&fabric->bport, fabric->fcs,FC_VF_ID_NULL , - &fabric->bport.port_cfg,NULL ); +bfa_fcs_lport_init (&fabric->bport, &fabric->bport.port_cfg);break ;case BFA_FCS_FABRIC_SM_LINK_UP :
@@ -161,7 +158,7 @@ bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,switch (event) {case BFA_FCS_FABRIC_SM_START : -if (bfa_pport_is_linkup (fabric->fcs->bfa)) { +if (bfa_fcport_is_linkup (fabric->fcs->bfa)) {bfa_sm_set_state (fabric, bfa_fcs_fabric_sm_flogi);bfa_fcs_fabric_login (fabric); }else
@@ -225,7 +222,8 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,switch (event) {case BFA_FCS_FABRIC_SM_CONT_OP : -bfa_pport_set_tx_bbcredit (fabric->fcs->bfa, fabric->bb_credit); +bfa_fcport_set_tx_bbcredit (fabric->fcs->bfa, + fabric->bb_credit); fabric->fab_type =BFA_FCS_FABRIC_SWITCHED ;if (fabric->auth_reqd && fabric->is_auth) {
@@ -252,7 +250,8 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,case BFA_FCS_FABRIC_SM_NO_FABRIC : fabric->fab_type =BFA_FCS_FABRIC_N2N ; -bfa_pport_set_tx_bbcredit (fabric->fcs->bfa, fabric->bb_credit); +bfa_fcport_set_tx_bbcredit (fabric->fcs->bfa, + fabric->bb_credit);bfa_fcs_fabric_notify_online (fabric);bfa_sm_set_state (fabric, bfa_fcs_fabric_sm_nofabric);break ;
@@ -308,7 +307,7 @@ bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,*/ static void bfa_fcs_fabric_sm_auth (struct bfa_fcs_fabric_s *fabric, -enum bfa_fcs_fabric_event event) +enum bfa_fcs_fabric_event event) {bfa_trc (fabric->fcs, fabric->bport.port_cfg.pwwn);bfa_trc (fabric->fcs, event);
@@ -419,7 +418,8 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,case BFA_FCS_FABRIC_SM_NO_FABRIC :bfa_trc (fabric->fcs, fabric->bb_credit); -bfa_pport_set_tx_bbcredit (fabric->fcs->bfa, fabric->bb_credit); +bfa_fcport_set_tx_bbcredit (fabric->fcs->bfa, + fabric->bb_credit);break ;default :
@@ -467,7 +467,7 @@ bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,*/ static void bfa_fcs_fabric_sm_evfp (struct bfa_fcs_fabric_s *fabric, -enum bfa_fcs_fabric_event event) +enum bfa_fcs_fabric_event event) {bfa_trc (fabric->fcs, fabric->bport.port_cfg.pwwn);bfa_trc (fabric->fcs, event);
@@ -563,32 +563,24 @@ void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric) {struct bfa_port_cfg_s *port_cfg = &fabric->bport.port_cfg; -struct bfa_adapter_attr_s adapter_attr; -struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; +char model[BFA_ADAPTER_MODEL_NAME_LEN ] = {0 }; +struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; -bfa_os_memset ((void *)&adapter_attr,0 , -sizeof (struct bfa_adapter_attr_s )); -bfa_ioc_get_adapter_attr (&fabric->fcs->bfa->ioc, &adapter_attr); +bfa_ioc_get_adapter_model (&fabric->fcs->bfa->ioc, model); -/* -* Model name/number -*/ -strncpy ((char *)&port_cfg->sym_name, adapter_attr.model, +/* Model name/number */ +strncpy ((char *)&port_cfg->sym_name, model,BFA_FCS_PORT_SYMBNAME_MODEL_SZ );strncat ((char *)&port_cfg->sym_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR ,sizeof (BFA_FCS_PORT_SYMBNAME_SEPARATOR )); -/* -* Driver Version -*/ +/* Driver Version */ strncat ((char *)&port_cfg->sym_name, (char *)driver_info->version,BFA_FCS_PORT_SYMBNAME_VERSION_SZ );strncat ((char *)&port_cfg->sym_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR ,sizeof (BFA_FCS_PORT_SYMBNAME_SEPARATOR )); -/* -* Host machine name -*/ +/* Host machine name */ strncat ((char *)&port_cfg->sym_name, (char *)driver_info->host_machine_name,BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ );
@@ -602,7 +594,8 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)*/ if (driver_info->host_os_patch[0 ] =='\0' ) {strncat ((char *)&port_cfg->sym_name, - (char *)driver_info->host_os_name,BFA_FCS_OS_STR_LEN ); + (char *)driver_info->host_os_name, +BFA_FCS_OS_STR_LEN );strncat ((char *)&port_cfg->sym_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR ,sizeof (BFA_FCS_PORT_SYMBNAME_SEPARATOR ));
@@ -614,17 +607,13 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)BFA_FCS_PORT_SYMBNAME_SEPARATOR , sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR)); -/* -* Append host OS Patch Info -*/ +/* Append host OS Patch Info */ strncat ((char *)&port_cfg->sym_name, (char *)driver_info->host_os_patch,BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ ); } -/* -* null terminate -*/ +/* null terminate */ port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN -1 ] =0 ; }
@@ -645,9 +634,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)break ;case BFA_STATUS_INVALID_MAC : -/* -* Only for CNA -*/ +/* Only for CNA */ fabric->stats.flogi_acc_err++;bfa_sm_send_event (fabric,BFA_FCS_FABRIC_SM_RETRY_OP );
@@ -685,7 +672,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)bfa_trc (fabric->fcs, fabric->bb_credit);if (!bfa_lps_is_brcd_fabric (fabric->lps)) - fabric->fabric_name =bfa_lps_get_peer_nwwn (fabric->lps); + fabric->fabric_name =bfa_lps_get_peer_nwwn (fabric->lps);/* * Check port type. It should be 1 = F-port.
@@ -708,21 +695,20 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)bfa_trc (fabric->fcs, fabric->is_npiv);bfa_trc (fabric->fcs, fabric->is_auth); } -/** -* Allocate and send FLOGI. +* Allocate and send FLOGI. */ static void bfa_fcs_fabric_login (struct bfa_fcs_fabric_s *fabric) { -struct bfa_s *bfa = fabric->fcs->bfa; -struct bfa_port_cfg_s *pcfg = &fabric->bport.port_cfg; -u8 alpa =0 ; +struct bfa_s *bfa = fabric->fcs->bfa; +struct bfa_port_cfg_s *pcfg = &fabric->bport.port_cfg; +u8 alpa =0 ; -if (bfa_pport_get_topology (bfa) ==BFA_PPORT_TOPOLOGY_LOOP ) - alpa =bfa_pport_get_myalpa (bfa); +if (bfa_fcport_get_topology (bfa) ==BFA_PPORT_TOPOLOGY_LOOP ) + alpa =bfa_fcport_get_myalpa (bfa); -bfa_lps_flogi (fabric->lps, fabric, alpa,bfa_pport_get_maxfrsize (bfa), +bfa_lps_flogi (fabric->lps, fabric, alpa,bfa_fcport_get_maxfrsize (bfa), pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd); fabric->stats.flogi_sent++;
@@ -732,7 +718,7 @@ static void bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric) {struct bfa_fcs_vport_s *vport; -struct list_head *qe, *qen; +struct list_head *qe, *qen;bfa_trc (fabric->fcs, fabric->fabric_name);
@@ -745,7 +731,7 @@ bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric)bfa_fcs_port_online (&fabric->bport);list_for_each_safe (qe, qen, &fabric->vport_q) { - vport = (struct bfa_fcs_vport_s *)qe; + vport = (struct bfa_fcs_vport_s *) qe;bfa_fcs_vport_online (vport); } }
@@ -754,7 +740,7 @@ static void bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric) {struct bfa_fcs_vport_s *vport; -struct list_head *qe, *qen; +struct list_head *qe, *qen;bfa_trc (fabric->fcs, fabric->fabric_name); fabric->stats.fabric_offlines++;
@@ -763,7 +749,7 @@ bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric)* notify offline event first to vports and then base port. */ list_for_each_safe (qe, qen, &fabric->vport_q) { - vport = (struct bfa_fcs_vport_s *)qe; + vport = (struct bfa_fcs_vport_s *) qe;bfa_fcs_vport_offline (vport); }
@@ -788,10 +774,10 @@ static void bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric) {struct bfa_fcs_vport_s *vport; -struct list_head *qe, *qen; +struct list_head *qe, *qen;list_for_each_safe (qe, qen, &fabric->vport_q) { - vport = (struct bfa_fcs_vport_s *)qe; + vport = (struct bfa_fcs_vport_s *) qe;bfa_fcs_vport_delete (vport); }
@@ -814,10 +800,10 @@ bfa_fcs_fabric_delete_comp(void *cbarg)*/ /** -* Module initialization +* Attach time initialization. */ void -bfa_fcs_fabric_modinit (struct bfa_fcs_s *fcs) +bfa_fcs_fabric_attach (struct bfa_fcs_s *fcs) {struct bfa_fcs_fabric_s *fabric;
@@ -834,14 +820,20 @@ bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)bfa_assert (fabric->lps);/** -* Initialize fabric delete completion handler. Fabric deletion is complete -* when the last vport delete is complete. +* Initialize fabric delete completion handler. Fabric deletion is +* complete when the last vport delete is complete. */ bfa_wc_init (&fabric->wc, bfa_fcs_fabric_delete_comp, fabric); -bfa_wc_up (&fabric->wc);/* For the base port */ +bfa_wc_up (&fabric->wc);/* For the base port */ bfa_sm_set_state (fabric, bfa_fcs_fabric_sm_uninit); -bfa_sm_send_event (fabric,BFA_FCS_FABRIC_SM_CREATE ); +bfa_fcs_lport_attach (&fabric->bport, fabric->fcs,FC_VF_ID_NULL ,NULL ); +} + +void +bfa_fcs_fabric_modinit (struct bfa_fcs_s *fcs) +{ +bfa_sm_send_event (&fcs->fabric,BFA_FCS_FABRIC_SM_CREATE );bfa_trc (fcs,0 ); }
@@ -890,6 +882,12 @@ bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric)return bfa_sm_cmp_state (fabric, bfa_fcs_fabric_sm_loopback); } +bfa_boolean_t +bfa_fcs_fabric_is_auth_failed (struct bfa_fcs_fabric_s *fabric) +{ +return bfa_sm_cmp_state (fabric, bfa_fcs_fabric_sm_auth_failed); +} +enum bfa_pport_type bfa_fcs_fabric_port_type (struct bfa_fcs_fabric_s *fabric) {
@@ -964,6 +962,7 @@ bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric)bfa_wc_down (&fabric->wc); } +/** * Check if fabric is online. *
@@ -977,11 +976,13 @@ bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric)return bfa_sm_cmp_state (fabric, bfa_fcs_fabric_sm_online); } - +/** +* brief +* +*/ bfa_status_t bfa_fcs_fabric_addvf (struct bfa_fcs_fabric_s *vf,struct bfa_fcs_s *fcs, -struct bfa_port_cfg_s *port_cfg, -struct bfad_vf_s *vf_drv) +struct bfa_port_cfg_s *port_cfg,struct bfad_vf_s *vf_drv) {bfa_sm_set_state (vf, bfa_fcs_fabric_sm_uninit);return BFA_STATUS_OK ;
@@ -994,10 +995,10 @@ struct bfa_fcs_vport_s * bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn) {struct bfa_fcs_vport_s *vport; -struct list_head *qe; +struct list_head *qe;list_for_each (qe, &fabric->vport_q) { - vport = (struct bfa_fcs_vport_s *)qe; + vport = (struct bfa_fcs_vport_s *) qe;if (bfa_fcs_port_get_pwwn (&vport->lport) == pwwn)return vport; }
@@ -1010,7 +1011,7 @@ bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn)* * param[in] fabric - Fabric instance. This can be a base fabric or vf. * -* @return : 1 or more. +* @return : 1 or more. */ u16 bfa_fcs_fabric_vport_count (struct bfa_fcs_fabric_s *fabric)
@@ -1019,15 +1020,15 @@ bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric) }/** -* Unsolicited frame receive handling. +* Unsolicited frame receive handling. */ void bfa_fcs_fabric_uf_recv (struct bfa_fcs_fabric_s *fabric,struct fchs_s *fchs, -u16 len) +u16 len) { -u32 pid = fchs->d_id; +u32 pid = fchs->d_id;struct bfa_fcs_vport_s *vport; -struct list_head *qe; +struct list_head *qe;struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs +1 );struct fc_logi_s *flogi = (struct fc_logi_s *) els_cmd;
@@ -1075,7 +1076,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,* look for a matching local port ID */ list_for_each (qe, &fabric->vport_q) { - vport = (struct bfa_fcs_vport_s *)qe; + vport = (struct bfa_fcs_vport_s *) qe;if (vport->lport.pid == pid) {bfa_fcs_port_uf_recv (&vport->lport, fchs, len);return ;
@@ -1086,7 +1087,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, }/** -* Unsolicited frames to be processed by fabric. +* Unsolicited frames to be processed by fabric. */ static void bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
@@ -1110,11 +1111,11 @@ bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, }/** -* Process incoming FLOGI +* Process incoming FLOGI */ static void bfa_fcs_fabric_process_flogi (struct bfa_fcs_fabric_s *fabric, -struct fchs_s *fchs,u16 len) +struct fchs_s *fchs,u16 len) {struct fc_logi_s *flogi = (struct fc_logi_s *) (fchs +1 );struct bfa_fcs_port_s *bport = &fabric->bport;
@@ -1150,10 +1151,10 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) {struct bfa_port_cfg_s *pcfg = &fabric->bport.port_cfg;struct bfa_fcs_port_n2n_s *n2n_port = &fabric->bport.port_topo.pn2n; -struct bfa_s *bfa = fabric->fcs->bfa; +struct bfa_s *bfa = fabric->fcs->bfa;struct bfa_fcxp_s *fcxp; -u16 reqlen; -struct fchs_s fchs; +u16 reqlen; +struct fchs_s fchs; fcxp =bfa_fcs_fcxp_alloc (fabric->fcs);/**
@@ -1165,15 +1166,16 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) reqlen =fc_flogi_acc_build (&fchs,bfa_fcxp_get_reqbuf (fcxp),bfa_os_hton3b (FC_FABRIC_PORT ), n2n_port->reply_oxid, pcfg->pwwn, - pcfg->nwwn,bfa_pport_get_maxfrsize (bfa), -bfa_pport_get_rx_bbcredit (bfa)); + pcfg->nwwn, +bfa_fcport_get_maxfrsize (bfa), +bfa_fcport_get_rx_bbcredit (bfa));bfa_fcxp_send (fcxp,NULL , fabric->vf_id,bfa_lps_get_tag (fabric->lps), -BFA_FALSE ,FC_CLASS_3 , reqlen, &fchs, - bfa_fcs_fabric_flogiacc_comp, fabric, -FC_MAX_PDUSZ ,0 );/* Timeout 0 indicates no -* response expected -*/ +BFA_FALSE ,FC_CLASS_3 , + reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, +FC_MAX_PDUSZ ,0 );/* Timeout 0 indicates no +* response expected +*/ }/**
@@ -1214,24 +1216,17 @@ static void bfa_fcs_fabric_aen_post(struct bfa_fcs_port_s *port, enum bfa_port_aen_event event) { - union bfa_aen_data_u aen_data; + union bfa_aen_data_u aen_data;struct bfa_log_mod_s *logmod = port->fcs->logm; -wwn_t pwwn =bfa_fcs_port_get_pwwn (port); -wwn_t fwwn =bfa_fcs_port_get_fabric_name (port); -char pwwn_ptr[BFA_STRING_32 ]; -char fwwn_ptr[BFA_STRING_32 ]; +wwn_t pwwn =bfa_fcs_port_get_pwwn (port); +wwn_t fwwn =bfa_fcs_port_get_fabric_name (port); +char pwwn_ptr[BFA_STRING_32 ]; +char fwwn_ptr[BFA_STRING_32 ];wwn2str (pwwn_ptr, pwwn);wwn2str (fwwn_ptr, fwwn); - -switch (event) { -case BFA_PORT_AEN_FABRIC_NAME_CHANGE : -bfa_log (logmod,BFA_AEN_PORT_FABRIC_NAME_CHANGE , pwwn_ptr, - fwwn_ptr); -break ; -default : -break ; - } +bfa_log (logmod,BFA_LOG_CREATE_ID (BFA_AEN_CAT_PORT , event), + pwwn_ptr, fwwn_ptr); aen_data.port.pwwn = pwwn; aen_data.port.fwwn = fwwn;
@@ -1246,7 +1241,7 @@ bfa_fcs_fabric_aen_post(struct bfa_fcs_port_s *port,*/ void bfa_fcs_fabric_set_fabric_name (struct bfa_fcs_fabric_s *fabric, -wwn_t fabric_name) +wwn_t fabric_name) {bfa_trc (fabric->fcs, fabric_name);
@@ -1258,15 +1253,12 @@ bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, fabric->fabric_name = fabric_name; }else { fabric->fabric_name = fabric_name; -/* -* Generate a Event -*/ +/* Generate a Event */ bfa_fcs_fabric_aen_post (&fabric->bport, -BFA_PORT_AEN_FABRIC_NAME_CHANGE ); +BFA_PORT_AEN_FABRIC_NAME_CHANGE ); } } -/** * Not used by FCS. */
drivers/scsi/bfa/fcbuild.c +51 -73
355 lines not on this page · raw message
drivers/scsi/bfa/fcbuild.h +180 -119
348 lines not on this page · raw message
drivers/scsi/bfa/fcpim.c +74 -108
451 lines not on this page · raw message
drivers/scsi/bfa/fcs_fabric.h +28 -24
63 lines not on this page · raw message
drivers/scsi/bfa/fcs_fcpim.h +2 -6
@@ -34,11 +34,7 @@ void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);void bfa_fcs_itnim_pause (struct bfa_fcs_itnim_s *itnim);void bfa_fcs_itnim_resume (struct bfa_fcs_itnim_s *itnim); -/* -* Modudle init/cleanup routines. -*/ -void bfa_fcs_fcpim_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_fcpim_modexit (struct bfa_fcs_s *fcs);void bfa_fcs_fcpim_uf_recv (struct bfa_fcs_itnim_s *itnim,struct fchs_s *fchs, -u16 len); +u16 len); +#endif /* __FCS_FCPIM_H__ */
drivers/scsi/bfa/fcs_fcptm.h +11 -11
@@ -26,20 +26,20 @@* Following routines are from FCPTM and will be called by rport. */ struct bfa_fcs_tin_s *bfa_fcs_tin_create (struct bfa_fcs_rport_s *rport); -void bfa_fcs_tin_rport_offline (struct bfa_fcs_tin_s *tin); -void bfa_fcs_tin_rport_online (struct bfa_fcs_tin_s *tin); -void bfa_fcs_tin_delete (struct bfa_fcs_tin_s *tin); -void bfa_fcs_tin_rx_prli (struct bfa_fcs_tin_s *tin,struct fchs_s *fchs, -u16 len); -void bfa_fcs_tin_pause (struct bfa_fcs_tin_s *tin); -void bfa_fcs_tin_resume (struct bfa_fcs_tin_s *tin); +void bfa_fcs_tin_rport_offline (struct bfa_fcs_tin_s *tin); +void bfa_fcs_tin_rport_online (struct bfa_fcs_tin_s *tin); +void bfa_fcs_tin_delete (struct bfa_fcs_tin_s *tin); +void bfa_fcs_tin_rx_prli (struct bfa_fcs_tin_s *tin, +struct fchs_s *fchs,u16 len); +void bfa_fcs_tin_pause (struct bfa_fcs_tin_s *tin); +void bfa_fcs_tin_resume (struct bfa_fcs_tin_s *tin);/* * Modudle init/cleanup routines. */ -void bfa_fcs_fcptm_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_fcptm_modexit (struct bfa_fcs_s *fcs); -void bfa_fcs_fcptm_uf_recv (struct bfa_fcs_tin_s *tin,struct fchs_s *fchs, -u16 len); +void bfa_fcs_fcptm_modinit (struct bfa_fcs_s *fcs); +void bfa_fcs_fcptm_modexit (struct bfa_fcs_s *fcs); +void bfa_fcs_fcptm_uf_recv (struct bfa_fcs_tin_s *tin, +struct fchs_s *fchs,u16 len);#endif /* __FCS_FCPTM_H__ */
drivers/scsi/bfa/fcs_lport.h +19 -19
@@ -77,38 +77,38 @@/* * handler for unsolicied frames */ -void bfa_fcs_port_uf_recv (struct bfa_fcs_port_s *lport,struct fchs_s *fchs, -u16 len); +void bfa_fcs_port_uf_recv (struct bfa_fcs_port_s *lport,struct fchs_s *fchs, +u16 len);/* * Following routines will be called by Fabric to indicate port * online/offline to vport. */ -void bfa_fcs_lport_init (struct bfa_fcs_port_s *lport,struct bfa_fcs_s *fcs, -u16 vf_id,struct bfa_port_cfg_s *port_cfg, -struct bfa_fcs_vport_s *vport); -void bfa_fcs_port_online (struct bfa_fcs_port_s *port); -void bfa_fcs_port_offline (struct bfa_fcs_port_s *port); -void bfa_fcs_port_delete (struct bfa_fcs_port_s *port); -bfa_boolean_t bfa_fcs_port_is_online (struct bfa_fcs_port_s *port); +void bfa_fcs_lport_attach (struct bfa_fcs_port_s *lport,struct bfa_fcs_s *fcs, +u16 vf_id,struct bfa_fcs_vport_s *vport); +void bfa_fcs_lport_init (struct bfa_fcs_port_s *lport, +struct bfa_port_cfg_s *port_cfg); +void bfa_fcs_port_online (struct bfa_fcs_port_s *port); +void bfa_fcs_port_offline (struct bfa_fcs_port_s *port); +void bfa_fcs_port_delete (struct bfa_fcs_port_s *port);/* * Lookup rport based on PID */ -struct bfa_fcs_rport_s *bfa_fcs_port_get_rport_by_pid ( -struct bfa_fcs_port_s *port,u32 pid); +struct bfa_fcs_rport_s * +bfa_fcs_port_get_rport_by_pid (struct bfa_fcs_port_s *port,u32 pid);/* * Lookup rport based on PWWN */ -struct bfa_fcs_rport_s *bfa_fcs_port_get_rport_by_pwwn ( -struct bfa_fcs_port_s *port,wwn_t pwwn); -struct bfa_fcs_rport_s *bfa_fcs_port_get_rport_by_nwwn ( -struct bfa_fcs_port_s *port,wwn_t nwwn); -void bfa_fcs_port_add_rport (struct bfa_fcs_port_s *port, -struct bfa_fcs_rport_s *rport); -void bfa_fcs_port_del_rport (struct bfa_fcs_port_s *port, -struct bfa_fcs_rport_s *rport); +struct bfa_fcs_rport_s * +bfa_fcs_port_get_rport_by_pwwn (struct bfa_fcs_port_s *port,wwn_t pwwn); +struct bfa_fcs_rport_s * +bfa_fcs_port_get_rport_by_nwwn (struct bfa_fcs_port_s *port,wwn_t nwwn); +void bfa_fcs_port_add_rport (struct bfa_fcs_port_s *port, +struct bfa_fcs_rport_s *rport); +void bfa_fcs_port_del_rport (struct bfa_fcs_port_s *port, +struct bfa_fcs_rport_s *rport);void bfa_fcs_port_modinit (struct bfa_fcs_s *fcs);void bfa_fcs_port_modexit (struct bfa_fcs_s *fcs);
drivers/scsi/bfa/fcs_port.h +1 -2
@@ -26,7 +26,6 @@/* * fcs friend functions: only between fcs modules */ -void bfa_fcs_pport_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_pport_modexit (struct bfa_fcs_s *fcs); +void bfa_fcs_pport_attach (struct bfa_fcs_s *fcs);#endif /* __FCS_PPORT_H__ */
drivers/scsi/bfa/fcs_rport.h +8 -13
@@ -24,34 +24,29 @@#include <fcs/bfa_fcs_rport.h> -void bfa_fcs_rport_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_rport_modexit (struct bfa_fcs_s *fcs); -void bfa_fcs_rport_uf_recv (struct bfa_fcs_rport_s *rport,struct fchs_s *fchs, -u16 len); +u16 len);void bfa_fcs_rport_scn (struct bfa_fcs_rport_s *rport);struct bfa_fcs_rport_s *bfa_fcs_rport_create (struct bfa_fcs_port_s *port, -u32 pid); +u32 pid);void bfa_fcs_rport_delete (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_online (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_offline (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_start (struct bfa_fcs_port_s *port,struct fchs_s *rx_fchs, -struct fc_logi_s *plogi_rsp); +struct fc_logi_s *plogi_rsp);void bfa_fcs_rport_plogi_create (struct bfa_fcs_port_s *port, -struct fchs_s *rx_fchs, -struct fc_logi_s *plogi); +struct fchs_s *rx_fchs,struct fc_logi_s *plogi);void bfa_fcs_rport_plogi (struct bfa_fcs_rport_s *rport,struct fchs_s *fchs, -struct fc_logi_s *plogi); +struct fc_logi_s *plogi);void bfa_fcs_rport_logo_imp (struct bfa_fcs_rport_s *rport); +void bfa_fcs_rport_itnim_ack (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_itntm_ack (struct bfa_fcs_rport_s *rport); -void bfa_fcs_rport_tin_ack (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_fcptm_offline_done (struct bfa_fcs_rport_s *rport);int bfa_fcs_rport_get_state (struct bfa_fcs_rport_s *rport); -struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn (struct bfa_fcs_port_s *port, -wwn_t wwn); - +struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn ( +struct bfa_fcs_port_s *port,wwn_t wwn);/* Rport Features */ void bfa_fcs_rpf_init (struct bfa_fcs_rport_s *rport);
drivers/scsi/bfa/fcs_uf.h +1 -2
@@ -26,7 +26,6 @@/* * fcs friend functions: only between fcs modules */ -void bfa_fcs_uf_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_uf_modexit (struct bfa_fcs_s *fcs); +void bfa_fcs_uf_attach (struct bfa_fcs_s *fcs);#endif /* __FCS_UF_H__ */
drivers/scsi/bfa/fcs_vport.h +0 -9
@@ -22,18 +22,9 @@#include <fcs/bfa_fcs_vport.h> #include <defs/bfa_defs_pci.h> -/* -* Modudle init/cleanup routines. -*/ - -void bfa_fcs_vport_modinit (struct bfa_fcs_s *fcs); -void bfa_fcs_vport_modexit (struct bfa_fcs_s *fcs); -void bfa_fcs_vport_cleanup (struct bfa_fcs_vport_s *vport);void bfa_fcs_vport_online (struct bfa_fcs_vport_s *vport);void bfa_fcs_vport_offline (struct bfa_fcs_vport_s *vport);void bfa_fcs_vport_delete_comp (struct bfa_fcs_vport_s *vport); -u32 bfa_fcs_vport_get_max (struct bfa_fcs_s *fcs);#endif /* __FCS_VPORT_H__ */ -
drivers/scsi/bfa/fdmi.c +204 -160
748 lines not on this page · raw message
drivers/scsi/bfa/loop.c +12 -11
@@ -58,16 +58,17 @@ static const u8 port_loop_alpa_map[] = {/* * Local Functions */ -static bfa_status_t bfa_fcs_port_loop_send_plogi (struct bfa_fcs_port_s *port, -u8 alpa); - -static void bfa_fcs_port_loop_plogi_response (void *fcsarg, -struct bfa_fcxp_s *fcxp, -void *cbarg, -bfa_status_t req_status, -u32 rsp_len, -u32 resid_len, -struct fchs_s *rsp_fchs); +static bfa_status_t bfa_fcs_port_loop_send_plogi (struct bfa_fcs_port_s *port, +u8 alpa); + +static void bfa_fcs_port_loop_plogi_response (void *fcsarg, +struct bfa_fcxp_s *fcxp, +void *cbarg, +bfa_status_t req_status, +u32 rsp_len, +u32 resid_len, +struct fchs_s *rsp_fchs); +/** * Called by port to initializar in provate LOOP topology. */
@@ -162,7 +163,7 @@ bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, u8 alpa) len =fc_plogi_build (&fchs,bfa_fcxp_get_reqbuf (fcxp), alpa,bfa_fcs_port_get_fcid (port),0 , port->port_cfg.pwwn, port->port_cfg.nwwn, -bfa_pport_get_maxfrsize (port->fcs->bfa)); +bfa_fcport_get_maxfrsize (port->fcs->bfa)); bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, FC_CLASS_3, len, &fchs,
drivers/scsi/bfa/lport_api.c +29 -25
134 lines not on this page · raw message
Signature · 1 line
1.6.5.2