@@ -546,31 +546,47 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
546
546
__func__ );
547
547
}
548
548
549
- list_for_each_entry_safe (fcport , tf , & vha -> vp_fcports , list ) {
550
- ql_dbg (ql_dbg_edif , vha , 0xf084 ,
551
- "%s: sess %p %8phC lid %#04x s_id %06x logout %d\n" ,
552
- __func__ , fcport , fcport -> port_name ,
553
- fcport -> loop_id , fcport -> d_id .b24 ,
554
- fcport -> logout_on_delete );
555
-
556
- ql_dbg (ql_dbg_edif , vha , 0xf084 ,
557
- "keep %d els_logo %d disc state %d auth state %d stop state %d\n" ,
558
- fcport -> keep_nport_handle ,
559
- fcport -> send_els_logo , fcport -> disc_state ,
560
- fcport -> edif .auth_state , fcport -> edif .app_stop );
561
-
562
- if (atomic_read (& vha -> loop_state ) == LOOP_DOWN )
563
- break ;
549
+ if (N2N_TOPO (vha -> hw )) {
550
+ if (vha -> hw -> flags .n2n_fw_acc_sec )
551
+ set_bit (N2N_LINK_RESET , & vha -> dpc_flags );
552
+ else
553
+ set_bit (ISP_ABORT_NEEDED , & vha -> dpc_flags );
554
+ qla2xxx_wake_dpc (vha );
555
+ } else {
556
+ list_for_each_entry_safe (fcport , tf , & vha -> vp_fcports , list ) {
557
+ ql_dbg (ql_dbg_edif , vha , 0xf084 ,
558
+ "%s: sess %p %8phC lid %#04x s_id %06x logout %d\n" ,
559
+ __func__ , fcport , fcport -> port_name ,
560
+ fcport -> loop_id , fcport -> d_id .b24 ,
561
+ fcport -> logout_on_delete );
562
+
563
+ ql_dbg (ql_dbg_edif , vha , 0xf084 ,
564
+ "keep %d els_logo %d disc state %d auth state %d stop state %d\n" ,
565
+ fcport -> keep_nport_handle ,
566
+ fcport -> send_els_logo , fcport -> disc_state ,
567
+ fcport -> edif .auth_state , fcport -> edif .app_stop );
564
568
565
- fcport -> edif .app_started = 1 ;
566
- fcport -> edif .app_stop = 0 ;
569
+ if (atomic_read (& vha -> loop_state ) == LOOP_DOWN )
570
+ break ;
571
+ if (!fcport -> edif .secured_login )
572
+ continue ;
567
573
568
- ql_dbg (ql_dbg_edif , vha , 0x911e ,
569
- "%s wwpn %8phC calling qla_edif_reset_auth_wait\n" ,
570
- __func__ , fcport -> port_name );
571
- fcport -> edif .app_sess_online = 1 ;
572
- qla_edif_reset_auth_wait (fcport , DSC_LOGIN_PEND , 0 );
573
- qla_edif_sa_ctl_init (vha , fcport );
574
+ fcport -> edif .app_started = 1 ;
575
+ if (fcport -> edif .app_stop ||
576
+ (fcport -> disc_state != DSC_LOGIN_COMPLETE &&
577
+ fcport -> disc_state != DSC_LOGIN_PEND &&
578
+ fcport -> disc_state != DSC_DELETED )) {
579
+ /* no activity */
580
+ fcport -> edif .app_stop = 0 ;
581
+
582
+ ql_dbg (ql_dbg_edif , vha , 0x911e ,
583
+ "%s wwpn %8phC calling qla_edif_reset_auth_wait\n" ,
584
+ __func__ , fcport -> port_name );
585
+ fcport -> edif .app_sess_online = 1 ;
586
+ qla_edif_reset_auth_wait (fcport , DSC_LOGIN_PEND , 0 );
587
+ }
588
+ qla_edif_sa_ctl_init (vha , fcport );
589
+ }
574
590
}
575
591
576
592
if (vha -> pur_cinfo .enode_flags != ENODE_ACTIVE ) {
@@ -763,6 +779,7 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
763
779
764
780
SET_DID_STATUS (bsg_reply -> result , DID_OK );
765
781
appplogireply .prli_status = 1 ;
782
+ fcport -> edif .authok = 1 ;
766
783
if (!(fcport -> edif .rx_sa_set && fcport -> edif .tx_sa_set )) {
767
784
ql_dbg (ql_dbg_edif , vha , 0x911e ,
768
785
"%s: wwpn %8phC Both SA indexes has not been SET TX %d, RX %d.\n" ,
@@ -929,8 +946,9 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
929
946
app_reply -> ports [pcnt ].remote_pid = fcport -> d_id ;
930
947
931
948
ql_dbg (ql_dbg_edif , vha , 0x2058 ,
932
- "Found FC_SP fcport - nn %8phN pn %8phN pcnt %d portid=%06x\n" ,
933
- fcport -> node_name , fcport -> port_name , pcnt , fcport -> d_id .b24 );
949
+ "Found FC_SP fcport - nn %8phN pn %8phN pcnt %d portid=%06x secure %d.\n" ,
950
+ fcport -> node_name , fcport -> port_name , pcnt ,
951
+ fcport -> d_id .b24 , fcport -> edif .secured_login );
934
952
935
953
switch (fcport -> edif .auth_state ) {
936
954
case VND_CMD_AUTH_STATE_ELS_RCVD :
@@ -2012,6 +2030,33 @@ qla_edb_getnext(scsi_qla_host_t *vha)
2012
2030
return edbnode ;
2013
2031
}
2014
2032
2033
+ void
2034
+ qla_edif_timer (scsi_qla_host_t * vha )
2035
+ {
2036
+ struct qla_hw_data * ha = vha -> hw ;
2037
+
2038
+ if (!vha -> vp_idx && N2N_TOPO (ha ) && ha -> flags .n2n_fw_acc_sec ) {
2039
+ if (vha -> e_dbell .db_flags != EDB_ACTIVE &&
2040
+ ha -> edif_post_stop_cnt_down ) {
2041
+ ha -> edif_post_stop_cnt_down -- ;
2042
+
2043
+ /*
2044
+ * turn off auto 'Plogi Acc + secure=1' feature
2045
+ * Set Add FW option[3]
2046
+ * BIT_15, if.
2047
+ */
2048
+ if (ha -> edif_post_stop_cnt_down == 0 ) {
2049
+ ql_dbg (ql_dbg_async , vha , 0x911d ,
2050
+ "%s chip reset to turn off PLOGI ACC + secure\n" ,
2051
+ __func__ );
2052
+ set_bit (ISP_ABORT_NEEDED , & vha -> dpc_flags );
2053
+ }
2054
+ } else {
2055
+ ha -> edif_post_stop_cnt_down = 60 ;
2056
+ }
2057
+ }
2058
+ }
2059
+
2015
2060
/*
2016
2061
* app uses separate thread to read this. It'll wait until the doorbell
2017
2062
* is rung by the driver or the max wait time has expired
0 commit comments