aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcbuild.c')
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.c109
1 files changed, 52 insertions, 57 deletions
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index 9c725314b513..b7e253451654 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -18,16 +18,16 @@
18 * fcbuild.c - FC link service frame building and parsing routines 18 * fcbuild.c - FC link service frame building and parsing routines
19 */ 19 */
20 20
21#include "bfa_os_inc.h" 21#include "bfad_drv.h"
22#include "bfa_fcbuild.h" 22#include "bfa_fcbuild.h"
23 23
24/* 24/*
25 * static build functions 25 * static build functions
26 */ 26 */
27static void fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 27static void fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
28 u16 ox_id); 28 __be16 ox_id);
29static void fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 29static void fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
30 u16 ox_id); 30 __be16 ox_id);
31static struct fchs_s fc_els_req_tmpl; 31static struct fchs_s fc_els_req_tmpl;
32static struct fchs_s fc_els_rsp_tmpl; 32static struct fchs_s fc_els_rsp_tmpl;
33static struct fchs_s fc_bls_req_tmpl; 33static struct fchs_s fc_bls_req_tmpl;
@@ -48,7 +48,7 @@ fcbuild_init(void)
48 fc_els_req_tmpl.cat_info = FC_CAT_LD_REQUEST; 48 fc_els_req_tmpl.cat_info = FC_CAT_LD_REQUEST;
49 fc_els_req_tmpl.type = FC_TYPE_ELS; 49 fc_els_req_tmpl.type = FC_TYPE_ELS;
50 fc_els_req_tmpl.f_ctl = 50 fc_els_req_tmpl.f_ctl =
51 bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 51 bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ |
52 FCTL_SI_XFER); 52 FCTL_SI_XFER);
53 fc_els_req_tmpl.rx_id = FC_RXID_ANY; 53 fc_els_req_tmpl.rx_id = FC_RXID_ANY;
54 54
@@ -59,7 +59,7 @@ fcbuild_init(void)
59 fc_els_rsp_tmpl.cat_info = FC_CAT_LD_REPLY; 59 fc_els_rsp_tmpl.cat_info = FC_CAT_LD_REPLY;
60 fc_els_rsp_tmpl.type = FC_TYPE_ELS; 60 fc_els_rsp_tmpl.type = FC_TYPE_ELS;
61 fc_els_rsp_tmpl.f_ctl = 61 fc_els_rsp_tmpl.f_ctl =
62 bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 62 bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
63 FCTL_END_SEQ | FCTL_SI_XFER); 63 FCTL_END_SEQ | FCTL_SI_XFER);
64 fc_els_rsp_tmpl.rx_id = FC_RXID_ANY; 64 fc_els_rsp_tmpl.rx_id = FC_RXID_ANY;
65 65
@@ -68,7 +68,7 @@ fcbuild_init(void)
68 */ 68 */
69 fc_bls_req_tmpl.routing = FC_RTG_BASIC_LINK; 69 fc_bls_req_tmpl.routing = FC_RTG_BASIC_LINK;
70 fc_bls_req_tmpl.type = FC_TYPE_BLS; 70 fc_bls_req_tmpl.type = FC_TYPE_BLS;
71 fc_bls_req_tmpl.f_ctl = bfa_os_hton3b(FCTL_END_SEQ | FCTL_SI_XFER); 71 fc_bls_req_tmpl.f_ctl = bfa_hton3b(FCTL_END_SEQ | FCTL_SI_XFER);
72 fc_bls_req_tmpl.rx_id = FC_RXID_ANY; 72 fc_bls_req_tmpl.rx_id = FC_RXID_ANY;
73 73
74 /* 74 /*
@@ -78,7 +78,7 @@ fcbuild_init(void)
78 fc_bls_rsp_tmpl.cat_info = FC_CAT_BA_ACC; 78 fc_bls_rsp_tmpl.cat_info = FC_CAT_BA_ACC;
79 fc_bls_rsp_tmpl.type = FC_TYPE_BLS; 79 fc_bls_rsp_tmpl.type = FC_TYPE_BLS;
80 fc_bls_rsp_tmpl.f_ctl = 80 fc_bls_rsp_tmpl.f_ctl =
81 bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 81 bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
82 FCTL_END_SEQ | FCTL_SI_XFER); 82 FCTL_END_SEQ | FCTL_SI_XFER);
83 fc_bls_rsp_tmpl.rx_id = FC_RXID_ANY; 83 fc_bls_rsp_tmpl.rx_id = FC_RXID_ANY;
84 84
@@ -129,7 +129,7 @@ fcbuild_init(void)
129 fcp_fchs_tmpl.cat_info = FC_CAT_UNSOLICIT_CMD; 129 fcp_fchs_tmpl.cat_info = FC_CAT_UNSOLICIT_CMD;
130 fcp_fchs_tmpl.type = FC_TYPE_FCP; 130 fcp_fchs_tmpl.type = FC_TYPE_FCP;
131 fcp_fchs_tmpl.f_ctl = 131 fcp_fchs_tmpl.f_ctl =
132 bfa_os_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); 132 bfa_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER);
133 fcp_fchs_tmpl.seq_id = 1; 133 fcp_fchs_tmpl.seq_id = 1;
134 fcp_fchs_tmpl.rx_id = FC_RXID_ANY; 134 fcp_fchs_tmpl.rx_id = FC_RXID_ANY;
135} 135}
@@ -143,7 +143,7 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
143 fchs->cat_info = FC_CAT_UNSOLICIT_CTRL; 143 fchs->cat_info = FC_CAT_UNSOLICIT_CTRL;
144 fchs->type = FC_TYPE_SERVICES; 144 fchs->type = FC_TYPE_SERVICES;
145 fchs->f_ctl = 145 fchs->f_ctl =
146 bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 146 bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ |
147 FCTL_SI_XFER); 147 FCTL_SI_XFER);
148 fchs->rx_id = FC_RXID_ANY; 148 fchs->rx_id = FC_RXID_ANY;
149 fchs->d_id = (d_id); 149 fchs->d_id = (d_id);
@@ -157,7 +157,7 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
157} 157}
158 158
159void 159void
160fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 160fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
161{ 161{
162 memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s)); 162 memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s));
163 fchs->d_id = (d_id); 163 fchs->d_id = (d_id);
@@ -166,7 +166,7 @@ fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
166} 166}
167 167
168static void 168static void
169fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 169fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
170{ 170{
171 memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s)); 171 memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s));
172 fchs->d_id = d_id; 172 fchs->d_id = d_id;
@@ -196,7 +196,7 @@ fc_els_rsp_parse(struct fchs_s *fchs, int len)
196} 196}
197 197
198static void 198static void
199fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 199fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
200{ 200{
201 memcpy(fchs, &fc_bls_rsp_tmpl, sizeof(struct fchs_s)); 201 memcpy(fchs, &fc_bls_rsp_tmpl, sizeof(struct fchs_s));
202 fchs->d_id = d_id; 202 fchs->d_id = d_id;
@@ -206,7 +206,7 @@ fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
206 206
207static u16 207static u16
208fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, 208fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
209 u16 ox_id, wwn_t port_name, wwn_t node_name, 209 __be16 ox_id, wwn_t port_name, wwn_t node_name,
210 u16 pdu_size, u8 els_code) 210 u16 pdu_size, u8 els_code)
211{ 211{
212 struct fc_logi_s *plogi = (struct fc_logi_s *) (pld); 212 struct fc_logi_s *plogi = (struct fc_logi_s *) (pld);
@@ -232,8 +232,8 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
232 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, 232 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size,
233 u8 set_npiv, u8 set_auth, u16 local_bb_credits) 233 u8 set_npiv, u8 set_auth, u16 local_bb_credits)
234{ 234{
235 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 235 u32 d_id = bfa_hton3b(FC_FABRIC_PORT);
236 u32 *vvl_info; 236 __be32 *vvl_info;
237 237
238 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 238 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
239 239
@@ -267,7 +267,7 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
267 267
268u16 268u16
269fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 269fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
270 u16 ox_id, wwn_t port_name, wwn_t node_name, 270 __be16 ox_id, wwn_t port_name, wwn_t node_name,
271 u16 pdu_size, u16 local_bb_credits) 271 u16 pdu_size, u16 local_bb_credits)
272{ 272{
273 u32 d_id = 0; 273 u32 d_id = 0;
@@ -289,7 +289,7 @@ u16
289fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 289fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
290 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size) 290 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size)
291{ 291{
292 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 292 u32 d_id = bfa_hton3b(FC_FABRIC_PORT);
293 293
294 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 294 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
295 295
@@ -392,7 +392,7 @@ fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
392 392
393u16 393u16
394fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, 394fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
395 u16 ox_id, enum bfa_lport_role role) 395 __be16 ox_id, enum bfa_lport_role role)
396{ 396{
397 struct fc_prli_s *prli = (struct fc_prli_s *) (pld); 397 struct fc_prli_s *prli = (struct fc_prli_s *) (pld);
398 398
@@ -456,9 +456,9 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
456 return sizeof(struct fc_logo_s); 456 return sizeof(struct fc_logo_s);
457} 457}
458 458
459static u16 459static u16
460fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, 460fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
461 u32 s_id, u16 ox_id, wwn_t port_name, 461 u32 s_id, __be16 ox_id, wwn_t port_name,
462 wwn_t node_name, u8 els_code) 462 wwn_t node_name, u8 els_code)
463{ 463{
464 memset(adisc, '\0', sizeof(struct fc_adisc_s)); 464 memset(adisc, '\0', sizeof(struct fc_adisc_s));
@@ -480,7 +480,7 @@ fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
480 480
481u16 481u16
482fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, 482fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
483 u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name) 483 u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name)
484{ 484{
485 return fc_adisc_x_build(fchs, adisc, d_id, s_id, ox_id, port_name, 485 return fc_adisc_x_build(fchs, adisc, d_id, s_id, ox_id, port_name,
486 node_name, FC_ELS_ADISC); 486 node_name, FC_ELS_ADISC);
@@ -488,7 +488,7 @@ fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
488 488
489u16 489u16
490fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, 490fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
491 u32 s_id, u16 ox_id, wwn_t port_name, 491 u32 s_id, __be16 ox_id, wwn_t port_name,
492 wwn_t node_name) 492 wwn_t node_name)
493{ 493{
494 return fc_adisc_x_build(fchs, adisc, d_id, s_id, ox_id, port_name, 494 return fc_adisc_x_build(fchs, adisc, d_id, s_id, ox_id, port_name,
@@ -592,7 +592,7 @@ fc_rrq_build(struct fchs_s *fchs, struct fc_rrq_s *rrq, u32 d_id, u32 s_id,
592 592
593u16 593u16
594fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, 594fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
595 u16 ox_id) 595 __be16 ox_id)
596{ 596{
597 struct fc_els_cmd_s *acc = pld; 597 struct fc_els_cmd_s *acc = pld;
598 598
@@ -606,7 +606,7 @@ fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
606 606
607u16 607u16
608fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id, 608fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id,
609 u32 s_id, u16 ox_id, u8 reason_code, 609 u32 s_id, __be16 ox_id, u8 reason_code,
610 u8 reason_code_expl) 610 u8 reason_code_expl)
611{ 611{
612 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 612 fc_els_rsp_build(fchs, d_id, s_id, ox_id);
@@ -622,7 +622,7 @@ fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id,
622 622
623u16 623u16
624fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, 624fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
625 u32 s_id, u16 ox_id, u16 rx_id) 625 u32 s_id, __be16 ox_id, u16 rx_id)
626{ 626{
627 fc_bls_rsp_build(fchs, d_id, s_id, ox_id); 627 fc_bls_rsp_build(fchs, d_id, s_id, ox_id);
628 628
@@ -638,7 +638,7 @@ fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
638 638
639u16 639u16
640fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, u32 d_id, 640fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, u32 d_id,
641 u32 s_id, u16 ox_id) 641 u32 s_id, __be16 ox_id)
642{ 642{
643 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 643 fc_els_rsp_build(fchs, d_id, s_id, ox_id);
644 memset(els_cmd, 0, sizeof(struct fc_els_cmd_s)); 644 memset(els_cmd, 0, sizeof(struct fc_els_cmd_s));
@@ -666,7 +666,7 @@ fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code)
666 666
667u16 667u16
668fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, 668fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
669 u32 d_id, u32 s_id, u16 ox_id, int num_pages) 669 u32 d_id, u32 s_id, __be16 ox_id, int num_pages)
670{ 670{
671 int page; 671 int page;
672 672
@@ -690,7 +690,7 @@ fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
690 690
691u16 691u16
692fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id, 692fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id,
693 u32 s_id, u16 ox_id, int num_pages) 693 u32 s_id, __be16 ox_id, int num_pages)
694{ 694{
695 int page; 695 int page;
696 696
@@ -728,7 +728,7 @@ fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id,
728 728
729u16 729u16
730fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id, 730fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id,
731 u32 s_id, u16 ox_id, u32 data_format, 731 u32 s_id, __be16 ox_id, u32 data_format,
732 struct fc_rnid_common_id_data_s *common_id_data, 732 struct fc_rnid_common_id_data_s *common_id_data,
733 struct fc_rnid_general_topology_data_s *gen_topo_data) 733 struct fc_rnid_general_topology_data_s *gen_topo_data)
734{ 734{
@@ -770,10 +770,10 @@ u16
770fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id, 770fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id,
771 u32 s_id, u32 *pid_list, u16 npids) 771 u32 s_id, u32 *pid_list, u16 npids)
772{ 772{
773 u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_os_hton3b(d_id)); 773 u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_hton3b(d_id));
774 int i = 0; 774 int i = 0;
775 775
776 fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0); 776 fc_els_req_build(fchs, bfa_hton3b(dctlr_id), s_id, 0);
777 777
778 memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s)); 778 memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s));
779 779
@@ -788,7 +788,7 @@ fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id,
788 788
789u16 789u16
790fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, 790fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
791 u32 d_id, u32 s_id, u16 ox_id, 791 u32 d_id, u32 s_id, __be16 ox_id,
792 struct fc_rpsc_speed_info_s *oper_speed) 792 struct fc_rpsc_speed_info_s *oper_speed)
793{ 793{
794 memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s)); 794 memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s));
@@ -807,11 +807,6 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
807 return sizeof(struct fc_rpsc_acc_s); 807 return sizeof(struct fc_rpsc_acc_s);
808} 808}
809 809
810/*
811 * TBD -
812 * . get rid of unnecessary memsets
813 */
814
815u16 810u16
816fc_logo_rsp_parse(struct fchs_s *fchs, int len) 811fc_logo_rsp_parse(struct fchs_s *fchs, int len)
817{ 812{
@@ -995,7 +990,7 @@ fc_rrq_rsp_parse(struct fchs_s *fchs, int len)
995} 990}
996 991
997u16 992u16
998fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, 993fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id,
999 u32 reason_code, u32 reason_expl) 994 u32 reason_code, u32 reason_expl)
1000{ 995{
1001 struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1); 996 struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1);
@@ -1045,7 +1040,7 @@ fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1045{ 1040{
1046 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1041 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1047 struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1); 1042 struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1);
1048 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1043 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1049 1044
1050 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1045 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1051 fc_gs_cthdr_build(cthdr, s_id, GS_GID_PN); 1046 fc_gs_cthdr_build(cthdr, s_id, GS_GID_PN);
@@ -1061,7 +1056,7 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1061{ 1056{
1062 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1057 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1063 fcgs_gpnid_req_t *gpnid = (fcgs_gpnid_req_t *) (cthdr + 1); 1058 fcgs_gpnid_req_t *gpnid = (fcgs_gpnid_req_t *) (cthdr + 1);
1064 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1059 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1065 1060
1066 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1061 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1067 fc_gs_cthdr_build(cthdr, s_id, GS_GPN_ID); 1062 fc_gs_cthdr_build(cthdr, s_id, GS_GPN_ID);
@@ -1077,7 +1072,7 @@ fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1077{ 1072{
1078 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1073 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1079 fcgs_gnnid_req_t *gnnid = (fcgs_gnnid_req_t *) (cthdr + 1); 1074 fcgs_gnnid_req_t *gnnid = (fcgs_gnnid_req_t *) (cthdr + 1);
1080 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1075 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1081 1076
1082 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1077 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1083 fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID); 1078 fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID);
@@ -1104,7 +1099,7 @@ u16
1104fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, 1099fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
1105 u8 set_br_reg, u32 s_id, u16 ox_id) 1100 u8 set_br_reg, u32 s_id, u16 ox_id)
1106{ 1101{
1107 u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1102 u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER);
1108 1103
1109 fc_els_req_build(fchs, d_id, s_id, ox_id); 1104 fc_els_req_build(fchs, d_id, s_id, ox_id);
1110 1105
@@ -1121,7 +1116,7 @@ u16
1121fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, 1116fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn,
1122 u32 s_id, u16 ox_id) 1117 u32 s_id, u16 ox_id)
1123{ 1118{
1124 u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1119 u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER);
1125 u16 payldlen; 1120 u16 payldlen;
1126 1121
1127 fc_els_req_build(fchs, d_id, s_id, ox_id); 1122 fc_els_req_build(fchs, d_id, s_id, ox_id);
@@ -1143,7 +1138,7 @@ fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1143{ 1138{
1144 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1139 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1145 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); 1140 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1);
1146 u32 type_value, d_id = bfa_os_hton3b(FC_NAME_SERVER); 1141 u32 type_value, d_id = bfa_hton3b(FC_NAME_SERVER);
1147 u8 index; 1142 u8 index;
1148 1143
1149 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1144 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
@@ -1167,7 +1162,7 @@ fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1167{ 1162{
1168 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1163 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1169 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); 1164 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1);
1170 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1165 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1171 1166
1172 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1167 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1173 fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID); 1168 fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID);
@@ -1187,7 +1182,7 @@ fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1187{ 1182{
1188 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1183 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1189 struct fcgs_rffid_req_s *rffid = (struct fcgs_rffid_req_s *)(cthdr + 1); 1184 struct fcgs_rffid_req_s *rffid = (struct fcgs_rffid_req_s *)(cthdr + 1);
1190 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1185 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1191 1186
1192 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1187 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1193 fc_gs_cthdr_build(cthdr, s_id, GS_RFF_ID); 1188 fc_gs_cthdr_build(cthdr, s_id, GS_RFF_ID);
@@ -1209,7 +1204,7 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
1209 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1204 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1210 struct fcgs_rspnid_req_s *rspnid = 1205 struct fcgs_rspnid_req_s *rspnid =
1211 (struct fcgs_rspnid_req_s *)(cthdr + 1); 1206 (struct fcgs_rspnid_req_s *)(cthdr + 1);
1212 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1207 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1213 1208
1214 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1209 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
1215 fc_gs_cthdr_build(cthdr, s_id, GS_RSPN_ID); 1210 fc_gs_cthdr_build(cthdr, s_id, GS_RSPN_ID);
@@ -1229,7 +1224,7 @@ fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, u8 fc4_type)
1229 1224
1230 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1225 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1231 struct fcgs_gidft_req_s *gidft = (struct fcgs_gidft_req_s *)(cthdr + 1); 1226 struct fcgs_gidft_req_s *gidft = (struct fcgs_gidft_req_s *)(cthdr + 1);
1232 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1227 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1233 1228
1234 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1229 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1235 1230
@@ -1249,7 +1244,7 @@ fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
1249{ 1244{
1250 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1245 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1251 struct fcgs_rpnid_req_s *rpnid = (struct fcgs_rpnid_req_s *)(cthdr + 1); 1246 struct fcgs_rpnid_req_s *rpnid = (struct fcgs_rpnid_req_s *)(cthdr + 1);
1252 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1247 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1253 1248
1254 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1249 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1255 fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID); 1250 fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID);
@@ -1267,7 +1262,7 @@ fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
1267{ 1262{
1268 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1263 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1269 struct fcgs_rnnid_req_s *rnnid = (struct fcgs_rnnid_req_s *)(cthdr + 1); 1264 struct fcgs_rnnid_req_s *rnnid = (struct fcgs_rnnid_req_s *)(cthdr + 1);
1270 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1265 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1271 1266
1272 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1267 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1273 fc_gs_cthdr_build(cthdr, s_id, GS_RNN_ID); 1268 fc_gs_cthdr_build(cthdr, s_id, GS_RNN_ID);
@@ -1286,7 +1281,7 @@ fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
1286 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1281 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1287 struct fcgs_rcsid_req_s *rcsid = 1282 struct fcgs_rcsid_req_s *rcsid =
1288 (struct fcgs_rcsid_req_s *) (cthdr + 1); 1283 (struct fcgs_rcsid_req_s *) (cthdr + 1);
1289 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1284 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1290 1285
1291 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1286 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1292 fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID); 1287 fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID);
@@ -1304,7 +1299,7 @@ fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
1304{ 1299{
1305 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1300 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1306 struct fcgs_rptid_req_s *rptid = (struct fcgs_rptid_req_s *)(cthdr + 1); 1301 struct fcgs_rptid_req_s *rptid = (struct fcgs_rptid_req_s *)(cthdr + 1);
1307 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1302 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1308 1303
1309 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1304 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1310 fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID); 1305 fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID);
@@ -1321,7 +1316,7 @@ fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id)
1321{ 1316{
1322 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1317 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1323 struct fcgs_ganxt_req_s *ganxt = (struct fcgs_ganxt_req_s *)(cthdr + 1); 1318 struct fcgs_ganxt_req_s *ganxt = (struct fcgs_ganxt_req_s *)(cthdr + 1);
1324 u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1319 u32 d_id = bfa_hton3b(FC_NAME_SERVER);
1325 1320
1326 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1321 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1327 fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT); 1322 fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT);
@@ -1341,7 +1336,7 @@ fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id,
1341{ 1336{
1342 1337
1343 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1338 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1344 u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1339 u32 d_id = bfa_hton3b(FC_MGMT_SERVER);
1345 1340
1346 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1341 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1347 fc_gs_fdmi_cthdr_build(cthdr, s_id, cmd_code); 1342 fc_gs_fdmi_cthdr_build(cthdr, s_id, cmd_code);
@@ -1356,7 +1351,7 @@ void
1356fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask) 1351fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask)
1357{ 1352{
1358 u8 index; 1353 u8 index;
1359 u32 *ptr = (u32 *) bit_mask; 1354 __be32 *ptr = (__be32 *) bit_mask;
1360 u32 type_value; 1355 u32 type_value;
1361 1356
1362 /* 1357 /*
@@ -1377,7 +1372,7 @@ fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn)
1377{ 1372{
1378 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1373 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1379 fcgs_gmal_req_t *gmal = (fcgs_gmal_req_t *) (cthdr + 1); 1374 fcgs_gmal_req_t *gmal = (fcgs_gmal_req_t *) (cthdr + 1);
1380 u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1375 u32 d_id = bfa_hton3b(FC_MGMT_SERVER);
1381 1376
1382 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1377 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1383 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GMAL_CMD, 1378 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GMAL_CMD,
@@ -1397,7 +1392,7 @@ fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn)
1397{ 1392{
1398 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1393 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
1399 fcgs_gfn_req_t *gfn = (fcgs_gfn_req_t *) (cthdr + 1); 1394 fcgs_gfn_req_t *gfn = (fcgs_gfn_req_t *) (cthdr + 1);
1400 u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1395 u32 d_id = bfa_hton3b(FC_MGMT_SERVER);
1401 1396
1402 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1397 fc_gs_fchdr_build(fchs, d_id, s_id, 0);
1403 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GFN_CMD, 1398 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GFN_CMD,