@@ -287,7 +287,7 @@ lpfc_ct_handle_mibreq(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocbq)
287287 u32 ulp_status = get_job_ulpstatus (phba , ctiocbq );
288288 u32 ulp_word4 = get_job_word4 (phba , ctiocbq );
289289 u32 did ;
290- u32 mi_cmd ;
290+ u16 mi_cmd ;
291291
292292 did = bf_get (els_rsp64_sid , & ctiocbq -> wqe .xmit_els_rsp );
293293 if (ulp_status ) {
@@ -311,7 +311,7 @@ lpfc_ct_handle_mibreq(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocbq)
311311
312312 ct_req = (struct lpfc_sli_ct_request * )ctiocbq -> cmd_dmabuf -> virt ;
313313
314- mi_cmd = ct_req -> CommandResponse .bits .CmdRsp ;
314+ mi_cmd = be16_to_cpu ( ct_req -> CommandResponse .bits .CmdRsp ) ;
315315 lpfc_printf_vlog (vport , KERN_INFO , LOG_ELS ,
316316 "6442 : MI Cmd : x%x Not Supported\n" , mi_cmd );
317317 lpfc_ct_reject_event (ndlp , ct_req ,
@@ -486,7 +486,7 @@ lpfc_free_ct_rsp(struct lpfc_hba *phba, struct lpfc_dmabuf *mlist)
486486}
487487
488488static struct lpfc_dmabuf *
489- lpfc_alloc_ct_rsp (struct lpfc_hba * phba , int cmdcode , struct ulp_bde64 * bpl ,
489+ lpfc_alloc_ct_rsp (struct lpfc_hba * phba , __be16 cmdcode , struct ulp_bde64 * bpl ,
490490 uint32_t size , int * entries )
491491{
492492 struct lpfc_dmabuf * mlist = NULL ;
@@ -507,8 +507,8 @@ lpfc_alloc_ct_rsp(struct lpfc_hba *phba, int cmdcode, struct ulp_bde64 *bpl,
507507
508508 INIT_LIST_HEAD (& mp -> list );
509509
510- if (cmdcode == be16_to_cpu ( SLI_CTNS_GID_FT ) ||
511- cmdcode == be16_to_cpu ( SLI_CTNS_GFF_ID ) )
510+ if (be16_to_cpu ( cmdcode ) == SLI_CTNS_GID_FT ||
511+ be16_to_cpu ( cmdcode ) == SLI_CTNS_GFF_ID )
512512 mp -> virt = lpfc_mbuf_alloc (phba , MEM_PRI , & (mp -> phys ));
513513 else
514514 mp -> virt = lpfc_mbuf_alloc (phba , 0 , & (mp -> phys ));
@@ -671,7 +671,7 @@ lpfc_ct_cmd(struct lpfc_vport *vport, struct lpfc_dmabuf *inmp,
671671 struct ulp_bde64 * bpl = (struct ulp_bde64 * ) bmp -> virt ;
672672 struct lpfc_dmabuf * outmp ;
673673 int cnt = 0 , status ;
674- int cmdcode = ((struct lpfc_sli_ct_request * ) inmp -> virt )->
674+ __be16 cmdcode = ((struct lpfc_sli_ct_request * )inmp -> virt )->
675675 CommandResponse .bits .CmdRsp ;
676676
677677 bpl ++ ; /* Skip past ct request */
@@ -1043,38 +1043,38 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10431043 outp ,
10441044 CTreq -> un .gid .Fc4Type ,
10451045 get_job_data_placed (phba , rspiocb ));
1046- } else if (CTrsp -> CommandResponse .bits .CmdRsp ==
1047- be16_to_cpu ( SLI_CT_RESPONSE_FS_RJT ) ) {
1046+ } else if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1047+ SLI_CT_RESPONSE_FS_RJT ) {
10481048 /* NameServer Rsp Error */
10491049 if ((CTrsp -> ReasonCode == SLI_CT_UNABLE_TO_PERFORM_REQ )
10501050 && (CTrsp -> Explanation == SLI_CT_NO_FC4_TYPES )) {
10511051 lpfc_printf_vlog (vport , KERN_INFO ,
10521052 LOG_DISCOVERY ,
10531053 "0269 No NameServer Entries "
10541054 "Data: x%x x%x x%x x%x\n" ,
1055- CTrsp -> CommandResponse .bits .CmdRsp ,
1055+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10561056 (uint32_t ) CTrsp -> ReasonCode ,
10571057 (uint32_t ) CTrsp -> Explanation ,
10581058 vport -> fc_flag );
10591059
10601060 lpfc_debugfs_disc_trc (vport , LPFC_DISC_TRC_CT ,
10611061 "GID_FT no entry cmd:x%x rsn:x%x exp:x%x" ,
1062- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1062+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10631063 (uint32_t ) CTrsp -> ReasonCode ,
10641064 (uint32_t ) CTrsp -> Explanation );
10651065 } else {
10661066 lpfc_printf_vlog (vport , KERN_INFO ,
10671067 LOG_DISCOVERY ,
10681068 "0240 NameServer Rsp Error "
10691069 "Data: x%x x%x x%x x%x\n" ,
1070- CTrsp -> CommandResponse .bits .CmdRsp ,
1070+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10711071 (uint32_t ) CTrsp -> ReasonCode ,
10721072 (uint32_t ) CTrsp -> Explanation ,
10731073 vport -> fc_flag );
10741074
10751075 lpfc_debugfs_disc_trc (vport , LPFC_DISC_TRC_CT ,
10761076 "GID_FT rsp err1 cmd:x%x rsn:x%x exp:x%x" ,
1077- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1077+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10781078 (uint32_t ) CTrsp -> ReasonCode ,
10791079 (uint32_t ) CTrsp -> Explanation );
10801080 }
@@ -1085,14 +1085,14 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10851085 lpfc_printf_vlog (vport , KERN_ERR , LOG_TRACE_EVENT ,
10861086 "0241 NameServer Rsp Error "
10871087 "Data: x%x x%x x%x x%x\n" ,
1088- CTrsp -> CommandResponse .bits .CmdRsp ,
1088+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10891089 (uint32_t ) CTrsp -> ReasonCode ,
10901090 (uint32_t ) CTrsp -> Explanation ,
10911091 vport -> fc_flag );
10921092
10931093 lpfc_debugfs_disc_trc (vport , LPFC_DISC_TRC_CT ,
10941094 "GID_FT rsp err2 cmd:x%x rsn:x%x exp:x%x" ,
1095- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1095+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
10961096 (uint32_t ) CTrsp -> ReasonCode ,
10971097 (uint32_t ) CTrsp -> Explanation );
10981098 }
@@ -1247,8 +1247,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
12471247 /* Good status, continue checking */
12481248 CTreq = (struct lpfc_sli_ct_request * )inp -> virt ;
12491249 CTrsp = (struct lpfc_sli_ct_request * )outp -> virt ;
1250- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1251- cpu_to_be16 ( SLI_CT_RESPONSE_FS_ACC ) ) {
1250+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1251+ SLI_CT_RESPONSE_FS_ACC ) {
12521252 lpfc_printf_vlog (vport , KERN_INFO , LOG_DISCOVERY ,
12531253 "4105 NameServer Rsp Data: x%x x%x "
12541254 "x%x x%x sz x%x\n" ,
@@ -1262,40 +1262,40 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
12621262 outp ,
12631263 CTreq -> un .gid .Fc4Type ,
12641264 get_job_data_placed (phba , rspiocb ));
1265- } else if (CTrsp -> CommandResponse .bits .CmdRsp ==
1266- be16_to_cpu ( SLI_CT_RESPONSE_FS_RJT ) ) {
1265+ } else if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1266+ SLI_CT_RESPONSE_FS_RJT ) {
12671267 /* NameServer Rsp Error */
12681268 if ((CTrsp -> ReasonCode == SLI_CT_UNABLE_TO_PERFORM_REQ )
12691269 && (CTrsp -> Explanation == SLI_CT_NO_FC4_TYPES )) {
12701270 lpfc_printf_vlog (
12711271 vport , KERN_INFO , LOG_DISCOVERY ,
12721272 "4106 No NameServer Entries "
12731273 "Data: x%x x%x x%x x%x\n" ,
1274- CTrsp -> CommandResponse .bits .CmdRsp ,
1274+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
12751275 (uint32_t )CTrsp -> ReasonCode ,
12761276 (uint32_t )CTrsp -> Explanation ,
12771277 vport -> fc_flag );
12781278
12791279 lpfc_debugfs_disc_trc (
12801280 vport , LPFC_DISC_TRC_CT ,
12811281 "GID_PT no entry cmd:x%x rsn:x%x exp:x%x" ,
1282- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1282+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
12831283 (uint32_t )CTrsp -> ReasonCode ,
12841284 (uint32_t )CTrsp -> Explanation );
12851285 } else {
12861286 lpfc_printf_vlog (
12871287 vport , KERN_INFO , LOG_DISCOVERY ,
12881288 "4107 NameServer Rsp Error "
12891289 "Data: x%x x%x x%x x%x\n" ,
1290- CTrsp -> CommandResponse .bits .CmdRsp ,
1290+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
12911291 (uint32_t )CTrsp -> ReasonCode ,
12921292 (uint32_t )CTrsp -> Explanation ,
12931293 vport -> fc_flag );
12941294
12951295 lpfc_debugfs_disc_trc (
12961296 vport , LPFC_DISC_TRC_CT ,
12971297 "GID_PT rsp err1 cmd:x%x rsn:x%x exp:x%x" ,
1298- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1298+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
12991299 (uint32_t )CTrsp -> ReasonCode ,
13001300 (uint32_t )CTrsp -> Explanation );
13011301 }
@@ -1304,15 +1304,15 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
13041304 lpfc_printf_vlog (vport , KERN_ERR , LOG_TRACE_EVENT ,
13051305 "4109 NameServer Rsp Error "
13061306 "Data: x%x x%x x%x x%x\n" ,
1307- CTrsp -> CommandResponse .bits .CmdRsp ,
1307+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
13081308 (uint32_t )CTrsp -> ReasonCode ,
13091309 (uint32_t )CTrsp -> Explanation ,
13101310 vport -> fc_flag );
13111311
13121312 lpfc_debugfs_disc_trc (
13131313 vport , LPFC_DISC_TRC_CT ,
13141314 "GID_PT rsp err2 cmd:x%x rsn:x%x exp:x%x" ,
1315- ( uint32_t ) CTrsp -> CommandResponse .bits .CmdRsp ,
1315+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
13161316 (uint32_t )CTrsp -> ReasonCode ,
13171317 (uint32_t )CTrsp -> Explanation );
13181318 }
@@ -1391,8 +1391,8 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
13911391 (fbits & FC4_FEATURE_INIT ) ? "Initiator" : " " ,
13921392 (fbits & FC4_FEATURE_TARGET ) ? "Target" : " " );
13931393
1394- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1395- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) ) {
1394+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1395+ SLI_CT_RESPONSE_FS_ACC ) {
13961396 if ((fbits & FC4_FEATURE_INIT ) &&
13971397 !(fbits & FC4_FEATURE_TARGET )) {
13981398 lpfc_printf_vlog (vport , KERN_INFO ,
@@ -1631,7 +1631,7 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
16311631 "0209 CT Request completes, latt %d, "
16321632 "ulp_status x%x CmdRsp x%x, Context x%x, Tag x%x\n" ,
16331633 latt , ulp_status ,
1634- CTrsp -> CommandResponse .bits .CmdRsp ,
1634+ be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ,
16351635 get_job_ulpcontext (phba , cmdiocb ), cmdiocb -> iotag );
16361636
16371637 lpfc_debugfs_disc_trc (vport , LPFC_DISC_TRC_CT ,
@@ -1681,8 +1681,8 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
16811681
16821682 outp = cmdiocb -> rsp_dmabuf ;
16831683 CTrsp = (struct lpfc_sli_ct_request * )outp -> virt ;
1684- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1685- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) )
1684+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1685+ SLI_CT_RESPONSE_FS_ACC )
16861686 vport -> ct_flags |= FC_CT_RFT_ID ;
16871687 }
16881688 lpfc_cmpl_ct (phba , cmdiocb , rspiocb );
@@ -1702,8 +1702,8 @@ lpfc_cmpl_ct_cmd_rnn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
17021702
17031703 outp = cmdiocb -> rsp_dmabuf ;
17041704 CTrsp = (struct lpfc_sli_ct_request * ) outp -> virt ;
1705- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1706- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) )
1705+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1706+ SLI_CT_RESPONSE_FS_ACC )
17071707 vport -> ct_flags |= FC_CT_RNN_ID ;
17081708 }
17091709 lpfc_cmpl_ct (phba , cmdiocb , rspiocb );
@@ -1723,8 +1723,8 @@ lpfc_cmpl_ct_cmd_rspn_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
17231723
17241724 outp = cmdiocb -> rsp_dmabuf ;
17251725 CTrsp = (struct lpfc_sli_ct_request * )outp -> virt ;
1726- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1727- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) )
1726+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1727+ SLI_CT_RESPONSE_FS_ACC )
17281728 vport -> ct_flags |= FC_CT_RSPN_ID ;
17291729 }
17301730 lpfc_cmpl_ct (phba , cmdiocb , rspiocb );
@@ -1744,8 +1744,8 @@ lpfc_cmpl_ct_cmd_rsnn_nn(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
17441744
17451745 outp = cmdiocb -> rsp_dmabuf ;
17461746 CTrsp = (struct lpfc_sli_ct_request * ) outp -> virt ;
1747- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1748- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) )
1747+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1748+ SLI_CT_RESPONSE_FS_ACC )
17491749 vport -> ct_flags |= FC_CT_RSNN_NN ;
17501750 }
17511751 lpfc_cmpl_ct (phba , cmdiocb , rspiocb );
@@ -1777,8 +1777,8 @@ lpfc_cmpl_ct_cmd_rff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
17771777
17781778 outp = cmdiocb -> rsp_dmabuf ;
17791779 CTrsp = (struct lpfc_sli_ct_request * )outp -> virt ;
1780- if (CTrsp -> CommandResponse .bits .CmdRsp ==
1781- be16_to_cpu ( SLI_CT_RESPONSE_FS_ACC ) )
1780+ if (be16_to_cpu ( CTrsp -> CommandResponse .bits .CmdRsp ) ==
1781+ SLI_CT_RESPONSE_FS_ACC )
17821782 vport -> ct_flags |= FC_CT_RFF_ID ;
17831783 }
17841784 lpfc_cmpl_ct (phba , cmdiocb , rspiocb );
@@ -2217,8 +2217,8 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22172217 struct lpfc_dmabuf * outp = cmdiocb -> rsp_dmabuf ;
22182218 struct lpfc_sli_ct_request * CTcmd = inp -> virt ;
22192219 struct lpfc_sli_ct_request * CTrsp = outp -> virt ;
2220- uint16_t fdmi_cmd = CTcmd -> CommandResponse .bits .CmdRsp ;
2221- uint16_t fdmi_rsp = CTrsp -> CommandResponse .bits .CmdRsp ;
2220+ __be16 fdmi_cmd = CTcmd -> CommandResponse .bits .CmdRsp ;
2221+ __be16 fdmi_rsp = CTrsp -> CommandResponse .bits .CmdRsp ;
22222222 struct lpfc_nodelist * ndlp , * free_ndlp = NULL ;
22232223 uint32_t latt , cmd , err ;
22242224 u32 ulp_status = get_job_ulpstatus (phba , rspiocb );
@@ -2278,7 +2278,7 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22782278
22792279 /* Check for a CT LS_RJT response */
22802280 cmd = be16_to_cpu (fdmi_cmd );
2281- if (fdmi_rsp == cpu_to_be16 ( SLI_CT_RESPONSE_FS_RJT ) ) {
2281+ if (be16_to_cpu ( fdmi_rsp ) == SLI_CT_RESPONSE_FS_RJT ) {
22822282 /* FDMI rsp failed */
22832283 lpfc_printf_vlog (vport , KERN_INFO , LOG_DISCOVERY | LOG_ELS ,
22842284 "0220 FDMI cmd failed FS_RJT Data: x%x" , cmd );
@@ -3110,7 +3110,7 @@ lpfc_fdmi_vendor_attr_mi(struct lpfc_vport *vport, void *attr)
31103110}
31113111
31123112/* RHBA attribute jump table */
3113- int (* lpfc_fdmi_hba_action [])
3113+ static int (* lpfc_fdmi_hba_action [])
31143114 (struct lpfc_vport * vport , void * attrbuf ) = {
31153115 /* Action routine Mask bit Attribute type */
31163116 lpfc_fdmi_hba_attr_wwnn , /* bit0 RHBA_NODENAME */
@@ -3134,7 +3134,7 @@ int (*lpfc_fdmi_hba_action[])
31343134};
31353135
31363136/* RPA / RPRT attribute jump table */
3137- int (* lpfc_fdmi_port_action [])
3137+ static int (* lpfc_fdmi_port_action [])
31383138 (struct lpfc_vport * vport , void * attrbuf ) = {
31393139 /* Action routine Mask bit Attribute type */
31403140 lpfc_fdmi_port_attr_fc4type , /* bit0 RPRT_SUPPORT_FC4_TYPES */
@@ -3570,7 +3570,7 @@ lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
35703570 struct lpfc_dmabuf * outp = cmdiocb -> rsp_dmabuf ;
35713571 struct lpfc_sli_ct_request * ctcmd = inp -> virt ;
35723572 struct lpfc_sli_ct_request * ctrsp = outp -> virt ;
3573- u16 rsp = ctrsp -> CommandResponse .bits .CmdRsp ;
3573+ __be16 rsp = ctrsp -> CommandResponse .bits .CmdRsp ;
35743574 struct app_id_object * app ;
35753575 struct lpfc_nodelist * ndlp = cmdiocb -> ndlp ;
35763576 u32 cmd , hash , bucket ;
@@ -3587,7 +3587,7 @@ lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
35873587 goto free_res ;
35883588 }
35893589 /* Check for a CT LS_RJT response */
3590- if (rsp == be16_to_cpu ( SLI_CT_RESPONSE_FS_RJT ) ) {
3590+ if (be16_to_cpu ( rsp ) == SLI_CT_RESPONSE_FS_RJT ) {
35913591 if (cmd != SLI_CTAS_DALLAPP_ID )
35923592 lpfc_printf_vlog (vport , KERN_DEBUG , LOG_DISCOVERY ,
35933593 "3306 VMID FS_RJT Data: x%x x%x x%x\n" ,
0 commit comments