aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_ct.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c76
1 files changed, 64 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index c701e4d611a9..dbe020e66b09 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -458,7 +458,7 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
458 ((lpfc_find_vport_by_did(phba, Did) == NULL) || 458 ((lpfc_find_vport_by_did(phba, Did) == NULL) ||
459 vport->cfg_peer_port_login)) { 459 vport->cfg_peer_port_login)) {
460 if ((vport->port_type != LPFC_NPIV_PORT) || 460 if ((vport->port_type != LPFC_NPIV_PORT) ||
461 (vport->fc_flag & FC_RFF_NOT_SUPPORTED) || 461 (!vport->ct_flags & FC_CT_RFF_ID) ||
462 (!vport->cfg_restrict_login)) { 462 (!vport->cfg_restrict_login)) {
463 ndlp = lpfc_setup_disc_node(vport, Did); 463 ndlp = lpfc_setup_disc_node(vport, Did);
464 if (ndlp) { 464 if (ndlp) {
@@ -778,8 +778,8 @@ out:
778 778
779 779
780static void 780static void
781lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, 781lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
782 struct lpfc_iocbq *rspiocb) 782 struct lpfc_iocbq *rspiocb)
783{ 783{
784 struct lpfc_vport *vport = cmdiocb->vport; 784 struct lpfc_vport *vport = cmdiocb->vport;
785 struct lpfc_dmabuf *inp; 785 struct lpfc_dmabuf *inp;
@@ -809,7 +809,7 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
809 809
810 /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */ 810 /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */
811 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 811 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
812 "0209 RFT request completes, latt %d, " 812 "0209 CT Request completes, latt %d, "
813 "ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n", 813 "ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n",
814 latt, irsp->ulpStatus, 814 latt, irsp->ulpStatus,
815 CTrsp->CommandResponse.bits.CmdRsp, 815 CTrsp->CommandResponse.bits.CmdRsp,
@@ -848,10 +848,28 @@ out:
848} 848}
849 849
850static void 850static void
851lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
852 struct lpfc_iocbq *rspiocb)
853{
854 IOCB_t *irsp = &rspiocb->iocb;
855 struct lpfc_vport *vport = cmdiocb->vport;
856
857 if (irsp->ulpStatus == IOSTAT_SUCCESS)
858 vport->ct_flags |= FC_CT_RFT_ID;
859 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
860 return;
861}
862
863static void
851lpfc_cmpl_ct_cmd_rnn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, 864lpfc_cmpl_ct_cmd_rnn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
852 struct lpfc_iocbq *rspiocb) 865 struct lpfc_iocbq *rspiocb)
853{ 866{
854 lpfc_cmpl_ct_cmd_rft_id(phba, cmdiocb, rspiocb); 867 IOCB_t *irsp = &rspiocb->iocb;
868 struct lpfc_vport *vport = cmdiocb->vport;
869
870 if (irsp->ulpStatus == IOSTAT_SUCCESS)
871 vport->ct_flags |= FC_CT_RNN_ID;
872 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
855 return; 873 return;
856} 874}
857 875
@@ -859,7 +877,12 @@ static void
859lpfc_cmpl_ct_cmd_rspn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, 877lpfc_cmpl_ct_cmd_rspn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
860 struct lpfc_iocbq *rspiocb) 878 struct lpfc_iocbq *rspiocb)
861{ 879{
862 lpfc_cmpl_ct_cmd_rft_id(phba, cmdiocb, rspiocb); 880 IOCB_t *irsp = &rspiocb->iocb;
881 struct lpfc_vport *vport = cmdiocb->vport;
882
883 if (irsp->ulpStatus == IOSTAT_SUCCESS)
884 vport->ct_flags |= FC_CT_RSPN_ID;
885 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
863 return; 886 return;
864} 887}
865 888
@@ -867,7 +890,24 @@ static void
867lpfc_cmpl_ct_cmd_rsnn_nn(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, 890lpfc_cmpl_ct_cmd_rsnn_nn(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
868 struct lpfc_iocbq *rspiocb) 891 struct lpfc_iocbq *rspiocb)
869{ 892{
870 lpfc_cmpl_ct_cmd_rft_id(phba, cmdiocb, rspiocb); 893 IOCB_t *irsp = &rspiocb->iocb;
894 struct lpfc_vport *vport = cmdiocb->vport;
895
896 if (irsp->ulpStatus == IOSTAT_SUCCESS)
897 vport->ct_flags |= FC_CT_RSNN_NN;
898 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
899 return;
900}
901
902static void
903lpfc_cmpl_ct_cmd_da_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
904 struct lpfc_iocbq *rspiocb)
905{
906 struct lpfc_vport *vport = cmdiocb->vport;
907
908 /* even if it fails we will act as though it succeeded. */
909 vport->ct_flags = 0;
910 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
871 return; 911 return;
872} 912}
873 913
@@ -878,10 +918,9 @@ lpfc_cmpl_ct_cmd_rff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
878 IOCB_t *irsp = &rspiocb->iocb; 918 IOCB_t *irsp = &rspiocb->iocb;
879 struct lpfc_vport *vport = cmdiocb->vport; 919 struct lpfc_vport *vport = cmdiocb->vport;
880 920
881 if (irsp->ulpStatus != IOSTAT_SUCCESS) 921 if (irsp->ulpStatus == IOSTAT_SUCCESS)
882 vport->fc_flag |= FC_RFF_NOT_SUPPORTED; 922 vport->ct_flags |= FC_CT_RFF_ID;
883 923 lpfc_cmpl_ct(phba, cmdiocb, rspiocb);
884 lpfc_cmpl_ct_cmd_rft_id(phba, cmdiocb, rspiocb);
885 return; 924 return;
886} 925}
887 926
@@ -1001,6 +1040,8 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1001 bpl->tus.f.bdeSize = RSPN_REQUEST_SZ; 1040 bpl->tus.f.bdeSize = RSPN_REQUEST_SZ;
1002 else if (cmdcode == SLI_CTNS_RSNN_NN) 1041 else if (cmdcode == SLI_CTNS_RSNN_NN)
1003 bpl->tus.f.bdeSize = RSNN_REQUEST_SZ; 1042 bpl->tus.f.bdeSize = RSNN_REQUEST_SZ;
1043 else if (cmdcode == SLI_CTNS_DA_ID)
1044 bpl->tus.f.bdeSize = DA_ID_REQUEST_SZ;
1004 else if (cmdcode == SLI_CTNS_RFF_ID) 1045 else if (cmdcode == SLI_CTNS_RFF_ID)
1005 bpl->tus.f.bdeSize = RFF_REQUEST_SZ; 1046 bpl->tus.f.bdeSize = RFF_REQUEST_SZ;
1006 else 1047 else
@@ -1034,6 +1075,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1034 break; 1075 break;
1035 1076
1036 case SLI_CTNS_RFT_ID: 1077 case SLI_CTNS_RFT_ID:
1078 vport->ct_flags &= ~FC_CT_RFT_ID;
1037 CtReq->CommandResponse.bits.CmdRsp = 1079 CtReq->CommandResponse.bits.CmdRsp =
1038 be16_to_cpu(SLI_CTNS_RFT_ID); 1080 be16_to_cpu(SLI_CTNS_RFT_ID);
1039 CtReq->un.rft.PortId = be32_to_cpu(vport->fc_myDID); 1081 CtReq->un.rft.PortId = be32_to_cpu(vport->fc_myDID);
@@ -1042,6 +1084,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1042 break; 1084 break;
1043 1085
1044 case SLI_CTNS_RNN_ID: 1086 case SLI_CTNS_RNN_ID:
1087 vport->ct_flags &= ~FC_CT_RNN_ID;
1045 CtReq->CommandResponse.bits.CmdRsp = 1088 CtReq->CommandResponse.bits.CmdRsp =
1046 be16_to_cpu(SLI_CTNS_RNN_ID); 1089 be16_to_cpu(SLI_CTNS_RNN_ID);
1047 CtReq->un.rnn.PortId = be32_to_cpu(vport->fc_myDID); 1090 CtReq->un.rnn.PortId = be32_to_cpu(vport->fc_myDID);
@@ -1051,6 +1094,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1051 break; 1094 break;
1052 1095
1053 case SLI_CTNS_RSPN_ID: 1096 case SLI_CTNS_RSPN_ID:
1097 vport->ct_flags &= ~FC_CT_RSPN_ID;
1054 CtReq->CommandResponse.bits.CmdRsp = 1098 CtReq->CommandResponse.bits.CmdRsp =
1055 be16_to_cpu(SLI_CTNS_RSPN_ID); 1099 be16_to_cpu(SLI_CTNS_RSPN_ID);
1056 CtReq->un.rspn.PortId = be32_to_cpu(vport->fc_myDID); 1100 CtReq->un.rspn.PortId = be32_to_cpu(vport->fc_myDID);
@@ -1061,6 +1105,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1061 cmpl = lpfc_cmpl_ct_cmd_rspn_id; 1105 cmpl = lpfc_cmpl_ct_cmd_rspn_id;
1062 break; 1106 break;
1063 case SLI_CTNS_RSNN_NN: 1107 case SLI_CTNS_RSNN_NN:
1108 vport->ct_flags &= ~FC_CT_RSNN_NN;
1064 CtReq->CommandResponse.bits.CmdRsp = 1109 CtReq->CommandResponse.bits.CmdRsp =
1065 be16_to_cpu(SLI_CTNS_RSNN_NN); 1110 be16_to_cpu(SLI_CTNS_RSNN_NN);
1066 memcpy(CtReq->un.rsnn.wwnn, &vport->fc_nodename, 1111 memcpy(CtReq->un.rsnn.wwnn, &vport->fc_nodename,
@@ -1071,8 +1116,15 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1071 CtReq->un.rsnn.symbname, size); 1116 CtReq->un.rsnn.symbname, size);
1072 cmpl = lpfc_cmpl_ct_cmd_rsnn_nn; 1117 cmpl = lpfc_cmpl_ct_cmd_rsnn_nn;
1073 break; 1118 break;
1119 case SLI_CTNS_DA_ID:
1120 /* Implement DA_ID Nameserver request */
1121 CtReq->CommandResponse.bits.CmdRsp =
1122 be16_to_cpu(SLI_CTNS_DA_ID);
1123 CtReq->un.da_id.port_id = be32_to_cpu(vport->fc_myDID);
1124 cmpl = lpfc_cmpl_ct_cmd_da_id;
1125 break;
1074 case SLI_CTNS_RFF_ID: 1126 case SLI_CTNS_RFF_ID:
1075 vport->fc_flag &= ~FC_RFF_NOT_SUPPORTED; 1127 vport->ct_flags &= ~FC_CT_RFF_ID;
1076 CtReq->CommandResponse.bits.CmdRsp = 1128 CtReq->CommandResponse.bits.CmdRsp =
1077 be16_to_cpu(SLI_CTNS_RFF_ID); 1129 be16_to_cpu(SLI_CTNS_RFF_ID);
1078 CtReq->un.rff.PortId = be32_to_cpu(vport->fc_myDID);; 1130 CtReq->un.rff.PortId = be32_to_cpu(vport->fc_myDID);;