aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorMaggie <xmzhang@brocade.com>2010-11-29 21:26:32 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:24:17 -0500
commit50444a340028119ce5ba45d60b4cf44e3e6e1b32 (patch)
treea1030723aaa84cc07f37f8c3d76766f8a9f1f19a /drivers/scsi/bfa
parent52f94b6fd0d1ff9d935c52f8a6360834ed871d92 (diff)
[SCSI] bfa: fix endianess sparse check warnings
First round of fix for the endianess check warnings from make C=2 CF="-D__CHECK_ENDIAN__". Signed-off-by: Maggie <xmzhang@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_cb_ioim.h2
-rw-r--r--drivers/scsi/bfa/bfa_defs_svc.h8
-rw-r--r--drivers/scsi/bfa/bfa_fc.h56
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.c44
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.h28
-rw-r--r--drivers/scsi/bfa/bfa_fcs.h14
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c226
-rw-r--r--drivers/scsi/bfa/bfa_fcs_rport.c2
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c5
-rw-r--r--drivers/scsi/bfa/bfa_ioc.h8
-rw-r--r--drivers/scsi/bfa/bfa_port.c2
-rw-r--r--drivers/scsi/bfa/bfa_svc.c4
-rw-r--r--drivers/scsi/bfa/bfi.h4
-rw-r--r--drivers/scsi/bfa/bfi_ms.h50
14 files changed, 228 insertions, 225 deletions
diff --git a/drivers/scsi/bfa/bfa_cb_ioim.h b/drivers/scsi/bfa/bfa_cb_ioim.h
index 6f021015f1f6..afb573878e20 100644
--- a/drivers/scsi/bfa/bfa_cb_ioim.h
+++ b/drivers/scsi/bfa/bfa_cb_ioim.h
@@ -32,7 +32,7 @@ static inline lun_t
32bfad_int_to_lun(u32 luno) 32bfad_int_to_lun(u32 luno)
33{ 33{
34 union { 34 union {
35 u16 scsi_lun[4]; 35 __be16 scsi_lun[4];
36 lun_t bfa_lun; 36 lun_t bfa_lun;
37 } lun; 37 } lun;
38 38
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h
index e24e9f7ca81f..648c84176722 100644
--- a/drivers/scsi/bfa/bfa_defs_svc.h
+++ b/drivers/scsi/bfa/bfa_defs_svc.h
@@ -34,8 +34,8 @@
34struct bfa_iocfc_intr_attr_s { 34struct bfa_iocfc_intr_attr_s {
35 u8 coalesce; /* enable/disable coalescing */ 35 u8 coalesce; /* enable/disable coalescing */
36 u8 rsvd[3]; 36 u8 rsvd[3];
37 u16 latency; /* latency in microseconds */ 37 __be16 latency; /* latency in microseconds */
38 u16 delay; /* delay in microseconds */ 38 __be16 delay; /* delay in microseconds */
39}; 39};
40 40
41/* 41/*
@@ -743,7 +743,7 @@ struct bfa_port_cfg_s {
743 u8 qos_enabled; /* qos enabled or not */ 743 u8 qos_enabled; /* qos enabled or not */
744 u8 cfg_hardalpa; /* is hard alpa configured */ 744 u8 cfg_hardalpa; /* is hard alpa configured */
745 u8 hardalpa; /* configured hard alpa */ 745 u8 hardalpa; /* configured hard alpa */
746 u16 maxfrsize; /* maximum frame size */ 746 __be16 maxfrsize; /* maximum frame size */
747 u8 rx_bbcredit; /* receive buffer credits */ 747 u8 rx_bbcredit; /* receive buffer credits */
748 u8 tx_bbcredit; /* transmit buffer credits */ 748 u8 tx_bbcredit; /* transmit buffer credits */
749 u8 ratelimit; /* ratelimit enabled or not */ 749 u8 ratelimit; /* ratelimit enabled or not */
@@ -843,7 +843,7 @@ struct bfa_fcport_fcf_s {
843 u8 fka_disabled; /* FKA is disabled */ 843 u8 fka_disabled; /* FKA is disabled */
844 u8 maxsz_verified; /* FCoE max size verified */ 844 u8 maxsz_verified; /* FCoE max size verified */
845 u8 fc_map[3]; /* FC map */ 845 u8 fc_map[3]; /* FC map */
846 u16 vlan; /* FCoE vlan tag/priority */ 846 __be16 vlan; /* FCoE vlan tag/priority */
847 u32 fka_adv_per; /* FIP ka advert. period */ 847 u32 fka_adv_per; /* FIP ka advert. period */
848 mac_t mac; /* FCF mac */ 848 mac_t mac; /* FCF mac */
849}; 849};
diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h
index e929d25b09e3..ce5274a017fa 100644
--- a/drivers/scsi/bfa/bfa_fc.h
+++ b/drivers/scsi/bfa/bfa_fc.h
@@ -82,7 +82,7 @@ struct fchs_s {
82 u8 df_ctl; /* data field control */ 82 u8 df_ctl; /* data field control */
83 u16 seq_cnt; /* sequence count */ 83 u16 seq_cnt; /* sequence count */
84 84
85 u16 ox_id; /* originator exchange ID */ 85 __be16 ox_id; /* originator exchange ID */
86 u16 rx_id; /* responder exchange ID */ 86 u16 rx_id; /* responder exchange ID */
87 87
88 u32 ro; /* relative offset */ 88 u32 ro; /* relative offset */
@@ -316,7 +316,7 @@ enum {
316struct fc_plogi_csp_s { 316struct fc_plogi_csp_s {
317 u8 verhi; /* FC-PH high version */ 317 u8 verhi; /* FC-PH high version */
318 u8 verlo; /* FC-PH low version */ 318 u8 verlo; /* FC-PH low version */
319 u16 bbcred; /* BB_Credit */ 319 __be16 bbcred; /* BB_Credit */
320 320
321#ifdef __BIGENDIAN 321#ifdef __BIGENDIAN
322 u8 ciro:1, /* continuously increasing RO */ 322 u8 ciro:1, /* continuously increasing RO */
@@ -355,12 +355,12 @@ struct fc_plogi_csp_s {
355 hg_supp:1; 355 hg_supp:1;
356#endif 356#endif
357 357
358 u16 rxsz; /* recieve data_field size */ 358 __be16 rxsz; /* recieve data_field size */
359 359
360 u16 conseq; 360 __be16 conseq;
361 u16 ro_bitmap; 361 __be16 ro_bitmap;
362 362
363 u32 e_d_tov; 363 __be32 e_d_tov;
364}; 364};
365 365
366/* 366/*
@@ -873,7 +873,7 @@ struct fc_rscn_event_s {
873struct fc_rscn_pl_s { 873struct fc_rscn_pl_s {
874 u8 command; 874 u8 command;
875 u8 pagelen; 875 u8 pagelen;
876 u16 payldlen; 876 __be16 payldlen;
877 struct fc_rscn_event_s event[1]; 877 struct fc_rscn_event_s event[1];
878}; 878};
879 879
@@ -926,9 +926,9 @@ struct fc_rnid_common_id_data_s {
926 926
927struct fc_rnid_general_topology_data_s { 927struct fc_rnid_general_topology_data_s {
928 u32 vendor_unique[4]; 928 u32 vendor_unique[4];
929 u32 asso_type; 929 __be32 asso_type;
930 u32 phy_port_num; 930 u32 phy_port_num;
931 u32 num_attached_nodes; 931 __be32 num_attached_nodes;
932 u32 node_mgmt:8; 932 u32 node_mgmt:8;
933 u32 ip_version:8; 933 u32 ip_version:8;
934 u32 udp_tcp_port_num:16; 934 u32 udp_tcp_port_num:16;
@@ -984,8 +984,8 @@ enum fc_rpsc_op_speed {
984}; 984};
985 985
986struct fc_rpsc_speed_info_s { 986struct fc_rpsc_speed_info_s {
987 u16 port_speed_cap; /*! see enum fc_rpsc_speed_cap */ 987 __be16 port_speed_cap; /*! see enum fc_rpsc_speed_cap */
988 u16 port_op_speed; /*! see enum fc_rpsc_op_speed */ 988 __be16 port_op_speed; /*! see enum fc_rpsc_op_speed */
989}; 989};
990 990
991enum link_e2e_beacon_subcmd { 991enum link_e2e_beacon_subcmd {
@@ -1056,9 +1056,9 @@ struct fc_rpsc_acc_s {
1056 1056
1057struct fc_rpsc2_cmd_s { 1057struct fc_rpsc2_cmd_s {
1058 struct fc_els_cmd_s els_cmd; 1058 struct fc_els_cmd_s els_cmd;
1059 u32 token; 1059 __be32 token;
1060 u16 resvd; 1060 u16 resvd;
1061 u16 num_pids; /* Number of pids in the request */ 1061 __be16 num_pids; /* Number of pids in the request */
1062 struct { 1062 struct {
1063 u32 rsvd1:8; 1063 u32 rsvd1:8;
1064 u32 pid:24; /* port identifier */ 1064 u32 pid:24; /* port identifier */
@@ -1076,12 +1076,12 @@ enum fc_rpsc2_port_type {
1076 * RPSC2 portInfo entry structure 1076 * RPSC2 portInfo entry structure
1077 */ 1077 */
1078struct fc_rpsc2_port_info_s { 1078struct fc_rpsc2_port_info_s {
1079 u32 pid; /* PID */ 1079 __be32 pid; /* PID */
1080 u16 resvd1; 1080 u16 resvd1;
1081 u16 index; /* port number / index */ 1081 __be16 index; /* port number / index */
1082 u8 resvd2; 1082 u8 resvd2;
1083 u8 type; /* port type N/NL/... */ 1083 u8 type; /* port type N/NL/... */
1084 u16 speed; /* port Operating Speed */ 1084 __be16 speed; /* port Operating Speed */
1085}; 1085};
1086 1086
1087/* 1087/*
@@ -1090,7 +1090,7 @@ struct fc_rpsc2_port_info_s {
1090struct fc_rpsc2_acc_s { 1090struct fc_rpsc2_acc_s {
1091 u8 els_cmd; 1091 u8 els_cmd;
1092 u8 resvd; 1092 u8 resvd;
1093 u16 num_pids; /* Number of pids in the request */ 1093 __be16 num_pids; /* Number of pids in the request */
1094 struct fc_rpsc2_port_info_s port_info[1]; /* port information */ 1094 struct fc_rpsc2_port_info_s port_info[1]; /* port information */
1095}; 1095};
1096 1096
@@ -1200,7 +1200,7 @@ struct fcp_cmnd_s {
1200 /* 1200 /*
1201 * !!! additional cdb bytes follows here!!! 1201 * !!! additional cdb bytes follows here!!!
1202 */ 1202 */
1203 u32 fcp_dl; /* bytes to be transferred */ 1203 __be32 fcp_dl; /* bytes to be transferred */
1204}; 1204};
1205 1205
1206#define fcp_cmnd_cdb_len(_cmnd) ((_cmnd)->addl_cdb_len * 4 + FCP_CMND_CDB_LEN) 1206#define fcp_cmnd_cdb_len(_cmnd) ((_cmnd)->addl_cdb_len * 4 + FCP_CMND_CDB_LEN)
@@ -1469,7 +1469,7 @@ struct fcgs_gidpn_resp_s {
1469struct fcgs_rftid_req_s { 1469struct fcgs_rftid_req_s {
1470 u32 rsvd:8; 1470 u32 rsvd:8;
1471 u32 dap:24; /* port identifier */ 1471 u32 dap:24; /* port identifier */
1472 u32 fc4_type[8]; /* fc4 types */ 1472 __be32 fc4_type[8]; /* fc4 types */
1473}; 1473};
1474 1474
1475/* 1475/*
@@ -1764,7 +1764,7 @@ struct fcgs_req_s {
1764 1764
1765/* Accept Response to GMAL */ 1765/* Accept Response to GMAL */
1766struct fcgs_gmal_resp_s { 1766struct fcgs_gmal_resp_s {
1767 u32 ms_len; /* Num of entries */ 1767 __be32 ms_len; /* Num of entries */
1768 u8 ms_ma[256]; 1768 u8 ms_ma[256];
1769}; 1769};
1770 1770
@@ -1856,8 +1856,8 @@ enum fdmi_port_attribute_type {
1856 * FDMI attribute 1856 * FDMI attribute
1857 */ 1857 */
1858struct fdmi_attr_s { 1858struct fdmi_attr_s {
1859 u16 type; 1859 __be16 type;
1860 u16 len; 1860 __be16 len;
1861 u8 value[1]; 1861 u8 value[1];
1862}; 1862};
1863 1863
@@ -1865,7 +1865,7 @@ struct fdmi_attr_s {
1865 * HBA Attribute Block 1865 * HBA Attribute Block
1866 */ 1866 */
1867struct fdmi_hba_attr_s { 1867struct fdmi_hba_attr_s {
1868 u32 attr_count; /* # of attributes */ 1868 __be32 attr_count; /* # of attributes */
1869 struct fdmi_attr_s hba_attr; /* n attributes */ 1869 struct fdmi_attr_s hba_attr; /* n attributes */
1870}; 1870};
1871 1871
@@ -1873,7 +1873,7 @@ struct fdmi_hba_attr_s {
1873 * Registered Port List 1873 * Registered Port List
1874 */ 1874 */
1875struct fdmi_port_list_s { 1875struct fdmi_port_list_s {
1876 u32 num_ports; /* number Of Port Entries */ 1876 __be32 num_ports; /* number Of Port Entries */
1877 wwn_t port_entry; /* one or more */ 1877 wwn_t port_entry; /* one or more */
1878}; 1878};
1879 1879
@@ -1881,7 +1881,7 @@ struct fdmi_port_list_s {
1881 * Port Attribute Block 1881 * Port Attribute Block
1882 */ 1882 */
1883struct fdmi_port_attr_s { 1883struct fdmi_port_attr_s {
1884 u32 attr_count; /* # of attributes */ 1884 __be32 attr_count; /* # of attributes */
1885 struct fdmi_attr_s port_attr; /* n attributes */ 1885 struct fdmi_attr_s port_attr; /* n attributes */
1886}; 1886};
1887 1887
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index 9c725314b513..322b11e10d67 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -25,9 +25,9 @@
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;
@@ -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);
@@ -233,7 +233,7 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
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_os_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;
@@ -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
@@ -458,7 +458,7 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
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{
@@ -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));
@@ -995,7 +995,7 @@ fc_rrq_rsp_parse(struct fchs_s *fchs, int len)
995} 995}
996 996
997u16 997u16
998fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, 998fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id,
999 u32 reason_code, u32 reason_expl) 999 u32 reason_code, u32 reason_expl)
1000{ 1000{
1001 struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1); 1001 struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1);
@@ -1356,7 +1356,7 @@ void
1356fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask) 1356fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask)
1357{ 1357{
1358 u8 index; 1358 u8 index;
1359 u32 *ptr = (u32 *) bit_mask; 1359 __be32 *ptr = (__be32 *) bit_mask;
1360 u32 type_value; 1360 u32 type_value;
1361 1361
1362 /* 1362 /*
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index 73abd02e53cc..1737e08e1c01 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -138,7 +138,7 @@ u16 fc_fdisc_build(struct fchs_s *buf, struct fc_logi_s *flogi, u32 s_id,
138 u16 pdu_size); 138 u16 pdu_size);
139 139
140u16 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, 140u16 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi,
141 u32 s_id, u16 ox_id, 141 u32 s_id, __be16 ox_id,
142 wwn_t port_name, wwn_t node_name, 142 wwn_t port_name, wwn_t node_name,
143 u16 pdu_size, 143 u16 pdu_size,
144 u16 local_bb_credits); 144 u16 local_bb_credits);
@@ -186,7 +186,7 @@ u16 fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
186 u16 pdu_size); 186 u16 pdu_size);
187 187
188u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, 188u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
189 u32 d_id, u32 s_id, u16 ox_id, wwn_t port_name, 189 u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name,
190 wwn_t node_name); 190 wwn_t node_name);
191 191
192enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld, 192enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld,
@@ -196,20 +196,20 @@ enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len,
196 wwn_t port_name, wwn_t node_name); 196 wwn_t port_name, wwn_t node_name);
197 197
198u16 fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, 198u16 fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
199 u32 d_id, u32 s_id, u16 ox_id, 199 u32 d_id, u32 s_id, __be16 ox_id,
200 wwn_t port_name, wwn_t node_name); 200 wwn_t port_name, wwn_t node_name);
201u16 fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, 201u16 fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt,
202 u32 d_id, u32 s_id, u16 ox_id, 202 u32 d_id, u32 s_id, __be16 ox_id,
203 u8 reason_code, u8 reason_code_expl); 203 u8 reason_code, u8 reason_code_expl);
204u16 fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, 204u16 fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd,
205 u32 d_id, u32 s_id, u16 ox_id); 205 u32 d_id, u32 s_id, __be16 ox_id);
206u16 fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, 206u16 fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id,
207 u32 s_id, u16 ox_id); 207 u32 s_id, u16 ox_id);
208 208
209enum fc_parse_status fc_prli_rsp_parse(struct fc_prli_s *prli, int len); 209enum fc_parse_status fc_prli_rsp_parse(struct fc_prli_s *prli, int len);
210 210
211u16 fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, 211u16 fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
212 u32 s_id, u16 ox_id, 212 u32 s_id, __be16 ox_id,
213 enum bfa_lport_role role); 213 enum bfa_lport_role role);
214 214
215u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, 215u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,
@@ -218,7 +218,7 @@ u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,
218 218
219u16 fc_rnid_acc_build(struct fchs_s *fchs, 219u16 fc_rnid_acc_build(struct fchs_s *fchs,
220 struct fc_rnid_acc_s *rnid_acc, u32 d_id, u32 s_id, 220 struct fc_rnid_acc_s *rnid_acc, u32 d_id, u32 s_id,
221 u16 ox_id, u32 data_format, 221 __be16 ox_id, u32 data_format,
222 struct fc_rnid_common_id_data_s *common_id_data, 222 struct fc_rnid_common_id_data_s *common_id_data,
223 struct fc_rnid_general_topology_data_s *gen_topo_data); 223 struct fc_rnid_general_topology_data_s *gen_topo_data);
224 224
@@ -228,7 +228,7 @@ u16 fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc,
228 u32 d_id, u32 s_id, u16 ox_id); 228 u32 d_id, u32 s_id, u16 ox_id);
229u16 fc_rpsc_acc_build(struct fchs_s *fchs, 229u16 fc_rpsc_acc_build(struct fchs_s *fchs,
230 struct fc_rpsc_acc_s *rpsc_acc, u32 d_id, u32 s_id, 230 struct fc_rpsc_acc_s *rpsc_acc, u32 d_id, u32 s_id,
231 u16 ox_id, struct fc_rpsc_speed_info_s *oper_speed); 231 __be16 ox_id, struct fc_rpsc_speed_info_s *oper_speed);
232u16 fc_gid_ft_build(struct fchs_s *fchs, void *pld, u32 s_id, 232u16 fc_gid_ft_build(struct fchs_s *fchs, void *pld, u32 s_id,
233 u8 fc4_type); 233 u8 fc4_type);
234 234
@@ -251,7 +251,7 @@ u16 fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id,
251 u32 s_id, u16 ox_id, wwn_t port_name); 251 u32 s_id, u16 ox_id, wwn_t port_name);
252 252
253u16 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, 253u16 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
254 u32 s_id, u16 ox_id); 254 u32 s_id, __be16 ox_id);
255 255
256u16 fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id, 256u16 fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id,
257 u16 cmd_code); 257 u16 cmd_code);
@@ -261,7 +261,7 @@ u16 fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
261void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask); 261void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
262 262
263void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 263void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
264 u16 ox_id); 264 __be16 ox_id);
265 265
266enum fc_parse_status fc_els_rsp_parse(struct fchs_s *fchs, int len); 266enum fc_parse_status fc_els_rsp_parse(struct fchs_s *fchs, int len);
267 267
@@ -274,15 +274,15 @@ enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name,
274 wwn_t port_name); 274 wwn_t port_name);
275 275
276u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, 276u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
277 u32 s_id, u16 ox_id, u16 rx_id); 277 u32 s_id, __be16 ox_id, u16 rx_id);
278 278
279int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code); 279int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code);
280 280
281u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, 281u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
282 u32 d_id, u32 s_id, u16 ox_id, int num_pages); 282 u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
283 283
284u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, 284u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc,
285 u32 d_id, u32 s_id, u16 ox_id, int num_pages); 285 u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
286 286
287u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len); 287u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len);
288 288
@@ -304,7 +304,7 @@ u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
304u16 fc_tprlo_rsp_parse(struct fchs_s *fchs, int len); 304u16 fc_tprlo_rsp_parse(struct fchs_s *fchs, int len);
305 305
306u16 fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 306u16 fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
307 u16 ox_id, u32 reason_code, u32 reason_expl); 307 __be16 ox_id, u32 reason_code, u32 reason_expl);
308 308
309u16 fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, 309u16 fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
310 u32 port_id); 310 u32 port_id);
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 9cb6a55977c3..5a8b928f8db3 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -109,7 +109,7 @@ struct bfa_fcs_lport_loop_s {
109 109
110struct bfa_fcs_lport_n2n_s { 110struct bfa_fcs_lport_n2n_s {
111 u32 rsvd; 111 u32 rsvd;
112 u16 reply_oxid; /* ox_id from the req flogi to be 112 __be16 reply_oxid; /* ox_id from the req flogi to be
113 *used in flogi acc */ 113 *used in flogi acc */
114 wwn_t rem_port_wwn; /* Attached port's wwn */ 114 wwn_t rem_port_wwn; /* Attached port's wwn */
115}; 115};
@@ -406,7 +406,7 @@ struct bfa_fcs_rport_s {
406 struct bfad_rport_s *rp_drv; /* driver peer instance */ 406 struct bfad_rport_s *rp_drv; /* driver peer instance */
407 u32 pid; /* port ID of rport */ 407 u32 pid; /* port ID of rport */
408 u16 maxfrsize; /* maximum frame size */ 408 u16 maxfrsize; /* maximum frame size */
409 u16 reply_oxid; /* OX_ID of inbound requests */ 409 __be16 reply_oxid; /* OX_ID of inbound requests */
410 enum fc_cos fc_cos; /* FC classes of service supp */ 410 enum fc_cos fc_cos; /* FC classes of service supp */
411 bfa_boolean_t cisc; /* CISC capable device */ 411 bfa_boolean_t cisc; /* CISC capable device */
412 bfa_boolean_t prlo; /* processing prlo or LOGO */ 412 bfa_boolean_t prlo; /* processing prlo or LOGO */
@@ -471,7 +471,7 @@ void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,
471void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, 471void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs,
472 struct fc_logi_s *plogi); 472 struct fc_logi_s *plogi);
473void bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport); 473void bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport);
474void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, u16 ox_id); 474void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id);
475 475
476void bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport); 476void bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport);
477void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport); 477void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport);
@@ -618,7 +618,7 @@ struct bfa_fcs_fdmi_hba_attr_s {
618 u8 option_rom_ver[BFA_VERSION_LEN]; 618 u8 option_rom_ver[BFA_VERSION_LEN];
619 u8 fw_version[8]; 619 u8 fw_version[8];
620 u8 os_name[256]; 620 u8 os_name[256];
621 u32 max_ct_pyld; 621 __be32 max_ct_pyld;
622}; 622};
623 623
624/* 624/*
@@ -626,9 +626,9 @@ struct bfa_fcs_fdmi_hba_attr_s {
626 */ 626 */
627struct bfa_fcs_fdmi_port_attr_s { 627struct bfa_fcs_fdmi_port_attr_s {
628 u8 supp_fc4_types[32]; /* supported FC4 types */ 628 u8 supp_fc4_types[32]; /* supported FC4 types */
629 u32 supp_speed; /* supported speed */ 629 __be32 supp_speed; /* supported speed */
630 u32 curr_speed; /* current Speed */ 630 __be32 curr_speed; /* current Speed */
631 u32 max_frm_size; /* max frame size */ 631 __be32 max_frm_size; /* max frame size */
632 u8 os_device_name[256]; /* OS device Name */ 632 u8 os_device_name[256]; /* OS device Name */
633 u8 host_name[256]; /* host name */ 633 u8 host_name[256]; /* host name */
634}; 634};
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 30665c744462..93c3588c715f 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -1569,6 +1569,7 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1569 struct fdmi_attr_s *attr; 1569 struct fdmi_attr_s *attr;
1570 u8 *curr_ptr; 1570 u8 *curr_ptr;
1571 u16 len, count; 1571 u16 len, count;
1572 u16 templen;
1572 1573
1573 /* 1574 /*
1574 * get hba attributes 1575 * get hba attributes
@@ -1594,69 +1595,69 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1594 */ 1595 */
1595 attr = (struct fdmi_attr_s *) curr_ptr; 1596 attr = (struct fdmi_attr_s *) curr_ptr;
1596 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_NODENAME); 1597 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_NODENAME);
1597 attr->len = sizeof(wwn_t); 1598 templen = sizeof(wwn_t);
1598 memcpy(attr->value, &bfa_fcs_lport_get_nwwn(port), attr->len); 1599 memcpy(attr->value, &bfa_fcs_lport_get_nwwn(port), templen);
1599 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1600 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1600 len += attr->len; 1601 len += templen;
1601 count++; 1602 count++;
1602 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1603 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1603 sizeof(attr->len)); 1604 sizeof(templen));
1604 1605
1605 /* 1606 /*
1606 * Manufacturer 1607 * Manufacturer
1607 */ 1608 */
1608 attr = (struct fdmi_attr_s *) curr_ptr; 1609 attr = (struct fdmi_attr_s *) curr_ptr;
1609 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MANUFACTURER); 1610 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MANUFACTURER);
1610 attr->len = (u16) strlen(fcs_hba_attr->manufacturer); 1611 templen = (u16) strlen(fcs_hba_attr->manufacturer);
1611 memcpy(attr->value, fcs_hba_attr->manufacturer, attr->len); 1612 memcpy(attr->value, fcs_hba_attr->manufacturer, templen);
1612 attr->len = fc_roundup(attr->len, sizeof(u32)); 1613 templen = fc_roundup(templen, sizeof(u32));
1613 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1614 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1614 len += attr->len; 1615 len += templen;
1615 count++; 1616 count++;
1616 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1617 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1617 sizeof(attr->len)); 1618 sizeof(templen));
1618 1619
1619 /* 1620 /*
1620 * Serial Number 1621 * Serial Number
1621 */ 1622 */
1622 attr = (struct fdmi_attr_s *) curr_ptr; 1623 attr = (struct fdmi_attr_s *) curr_ptr;
1623 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_SERIALNUM); 1624 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_SERIALNUM);
1624 attr->len = (u16) strlen(fcs_hba_attr->serial_num); 1625 templen = (u16) strlen(fcs_hba_attr->serial_num);
1625 memcpy(attr->value, fcs_hba_attr->serial_num, attr->len); 1626 memcpy(attr->value, fcs_hba_attr->serial_num, templen);
1626 attr->len = fc_roundup(attr->len, sizeof(u32)); 1627 templen = fc_roundup(templen, sizeof(u32));
1627 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1628 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1628 len += attr->len; 1629 len += templen;
1629 count++; 1630 count++;
1630 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1631 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1631 sizeof(attr->len)); 1632 sizeof(templen));
1632 1633
1633 /* 1634 /*
1634 * Model 1635 * Model
1635 */ 1636 */
1636 attr = (struct fdmi_attr_s *) curr_ptr; 1637 attr = (struct fdmi_attr_s *) curr_ptr;
1637 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL); 1638 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL);
1638 attr->len = (u16) strlen(fcs_hba_attr->model); 1639 templen = (u16) strlen(fcs_hba_attr->model);
1639 memcpy(attr->value, fcs_hba_attr->model, attr->len); 1640 memcpy(attr->value, fcs_hba_attr->model, templen);
1640 attr->len = fc_roundup(attr->len, sizeof(u32)); 1641 templen = fc_roundup(templen, sizeof(u32));
1641 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1642 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1642 len += attr->len; 1643 len += templen;
1643 count++; 1644 count++;
1644 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1645 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1645 sizeof(attr->len)); 1646 sizeof(templen));
1646 1647
1647 /* 1648 /*
1648 * Model Desc 1649 * Model Desc
1649 */ 1650 */
1650 attr = (struct fdmi_attr_s *) curr_ptr; 1651 attr = (struct fdmi_attr_s *) curr_ptr;
1651 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL_DESC); 1652 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL_DESC);
1652 attr->len = (u16) strlen(fcs_hba_attr->model_desc); 1653 templen = (u16) strlen(fcs_hba_attr->model_desc);
1653 memcpy(attr->value, fcs_hba_attr->model_desc, attr->len); 1654 memcpy(attr->value, fcs_hba_attr->model_desc, templen);
1654 attr->len = fc_roundup(attr->len, sizeof(u32)); 1655 templen = fc_roundup(templen, sizeof(u32));
1655 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1656 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1656 len += attr->len; 1657 len += templen;
1657 count++; 1658 count++;
1658 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1659 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1659 sizeof(attr->len)); 1660 sizeof(templen));
1660 1661
1661 /* 1662 /*
1662 * H/W Version 1663 * H/W Version
@@ -1664,14 +1665,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1664 if (fcs_hba_attr->hw_version[0] != '\0') { 1665 if (fcs_hba_attr->hw_version[0] != '\0') {
1665 attr = (struct fdmi_attr_s *) curr_ptr; 1666 attr = (struct fdmi_attr_s *) curr_ptr;
1666 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_HW_VERSION); 1667 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_HW_VERSION);
1667 attr->len = (u16) strlen(fcs_hba_attr->hw_version); 1668 templen = (u16) strlen(fcs_hba_attr->hw_version);
1668 memcpy(attr->value, fcs_hba_attr->hw_version, attr->len); 1669 memcpy(attr->value, fcs_hba_attr->hw_version, templen);
1669 attr->len = fc_roundup(attr->len, sizeof(u32)); 1670 templen = fc_roundup(templen, sizeof(u32));
1670 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1671 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1671 len += attr->len; 1672 len += templen;
1672 count++; 1673 count++;
1673 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1674 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1674 sizeof(attr->len)); 1675 sizeof(templen));
1675 } 1676 }
1676 1677
1677 /* 1678 /*
@@ -1679,14 +1680,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1679 */ 1680 */
1680 attr = (struct fdmi_attr_s *) curr_ptr; 1681 attr = (struct fdmi_attr_s *) curr_ptr;
1681 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_DRIVER_VERSION); 1682 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_DRIVER_VERSION);
1682 attr->len = (u16) strlen(fcs_hba_attr->driver_version); 1683 templen = (u16) strlen(fcs_hba_attr->driver_version);
1683 memcpy(attr->value, fcs_hba_attr->driver_version, attr->len); 1684 memcpy(attr->value, fcs_hba_attr->driver_version, templen);
1684 attr->len = fc_roundup(attr->len, sizeof(u32)); 1685 templen = fc_roundup(templen, sizeof(u32));
1685 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1686 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1686 len += attr->len;; 1687 len += templen;;
1687 count++; 1688 count++;
1688 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1689 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1689 sizeof(attr->len)); 1690 sizeof(templen));
1690 1691
1691 /* 1692 /*
1692 * Option Rom Version 1693 * Option Rom Version
@@ -1694,14 +1695,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1694 if (fcs_hba_attr->option_rom_ver[0] != '\0') { 1695 if (fcs_hba_attr->option_rom_ver[0] != '\0') {
1695 attr = (struct fdmi_attr_s *) curr_ptr; 1696 attr = (struct fdmi_attr_s *) curr_ptr;
1696 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_ROM_VERSION); 1697 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_ROM_VERSION);
1697 attr->len = (u16) strlen(fcs_hba_attr->option_rom_ver); 1698 templen = (u16) strlen(fcs_hba_attr->option_rom_ver);
1698 memcpy(attr->value, fcs_hba_attr->option_rom_ver, attr->len); 1699 memcpy(attr->value, fcs_hba_attr->option_rom_ver, templen);
1699 attr->len = fc_roundup(attr->len, sizeof(u32)); 1700 templen = fc_roundup(templen, sizeof(u32));
1700 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1701 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1701 len += attr->len; 1702 len += templen;
1702 count++; 1703 count++;
1703 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1704 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1704 sizeof(attr->len)); 1705 sizeof(templen));
1705 } 1706 }
1706 1707
1707 /* 1708 /*
@@ -1709,14 +1710,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1709 */ 1710 */
1710 attr = (struct fdmi_attr_s *) curr_ptr; 1711 attr = (struct fdmi_attr_s *) curr_ptr;
1711 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); 1712 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION);
1712 attr->len = (u16) strlen(fcs_hba_attr->driver_version); 1713 templen = (u16) strlen(fcs_hba_attr->driver_version);
1713 memcpy(attr->value, fcs_hba_attr->driver_version, attr->len); 1714 memcpy(attr->value, fcs_hba_attr->driver_version, templen);
1714 attr->len = fc_roundup(attr->len, sizeof(u32)); 1715 templen = fc_roundup(templen, sizeof(u32));
1715 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1716 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1716 len += attr->len; 1717 len += templen;
1717 count++; 1718 count++;
1718 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1719 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1719 sizeof(attr->len)); 1720 sizeof(templen));
1720 1721
1721 /* 1722 /*
1722 * OS Name 1723 * OS Name
@@ -1724,14 +1725,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1724 if (fcs_hba_attr->os_name[0] != '\0') { 1725 if (fcs_hba_attr->os_name[0] != '\0') {
1725 attr = (struct fdmi_attr_s *) curr_ptr; 1726 attr = (struct fdmi_attr_s *) curr_ptr;
1726 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_OS_NAME); 1727 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_OS_NAME);
1727 attr->len = (u16) strlen(fcs_hba_attr->os_name); 1728 templen = (u16) strlen(fcs_hba_attr->os_name);
1728 memcpy(attr->value, fcs_hba_attr->os_name, attr->len); 1729 memcpy(attr->value, fcs_hba_attr->os_name, templen);
1729 attr->len = fc_roundup(attr->len, sizeof(u32)); 1730 templen = fc_roundup(templen, sizeof(u32));
1730 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1731 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1731 len += attr->len; 1732 len += templen;
1732 count++; 1733 count++;
1733 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1734 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1734 sizeof(attr->len)); 1735 sizeof(templen));
1735 } 1736 }
1736 1737
1737 /* 1738 /*
@@ -1739,12 +1740,12 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1739 */ 1740 */
1740 attr = (struct fdmi_attr_s *) curr_ptr; 1741 attr = (struct fdmi_attr_s *) curr_ptr;
1741 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MAX_CT); 1742 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MAX_CT);
1742 attr->len = sizeof(fcs_hba_attr->max_ct_pyld); 1743 templen = sizeof(fcs_hba_attr->max_ct_pyld);
1743 memcpy(attr->value, &fcs_hba_attr->max_ct_pyld, attr->len); 1744 memcpy(attr->value, &fcs_hba_attr->max_ct_pyld, templen);
1744 len += attr->len; 1745 len += templen;
1745 count++; 1746 count++;
1746 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1747 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1747 sizeof(attr->len)); 1748 sizeof(templen));
1748 1749
1749 /* 1750 /*
1750 * Update size of payload 1751 * Update size of payload
@@ -1845,6 +1846,7 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
1845 u8 *curr_ptr; 1846 u8 *curr_ptr;
1846 u16 len; 1847 u16 len;
1847 u8 count = 0; 1848 u8 count = 0;
1849 u16 templen;
1848 1850
1849 /* 1851 /*
1850 * get port attributes 1852 * get port attributes
@@ -1863,54 +1865,54 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
1863 */ 1865 */
1864 attr = (struct fdmi_attr_s *) curr_ptr; 1866 attr = (struct fdmi_attr_s *) curr_ptr;
1865 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_FC4_TYPES); 1867 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_FC4_TYPES);
1866 attr->len = sizeof(fcs_port_attr.supp_fc4_types); 1868 templen = sizeof(fcs_port_attr.supp_fc4_types);
1867 memcpy(attr->value, fcs_port_attr.supp_fc4_types, attr->len); 1869 memcpy(attr->value, fcs_port_attr.supp_fc4_types, templen);
1868 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1870 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1869 len += attr->len; 1871 len += templen;
1870 ++count; 1872 ++count;
1871 attr->len = 1873 attr->len =
1872 cpu_to_be16(attr->len + sizeof(attr->type) + 1874 cpu_to_be16(templen + sizeof(attr->type) +
1873 sizeof(attr->len)); 1875 sizeof(templen));
1874 1876
1875 /* 1877 /*
1876 * Supported Speed 1878 * Supported Speed
1877 */ 1879 */
1878 attr = (struct fdmi_attr_s *) curr_ptr; 1880 attr = (struct fdmi_attr_s *) curr_ptr;
1879 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_SUPP_SPEED); 1881 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_SUPP_SPEED);
1880 attr->len = sizeof(fcs_port_attr.supp_speed); 1882 templen = sizeof(fcs_port_attr.supp_speed);
1881 memcpy(attr->value, &fcs_port_attr.supp_speed, attr->len); 1883 memcpy(attr->value, &fcs_port_attr.supp_speed, templen);
1882 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1884 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1883 len += attr->len; 1885 len += templen;
1884 ++count; 1886 ++count;
1885 attr->len = 1887 attr->len =
1886 cpu_to_be16(attr->len + sizeof(attr->type) + 1888 cpu_to_be16(templen + sizeof(attr->type) +
1887 sizeof(attr->len)); 1889 sizeof(templen));
1888 1890
1889 /* 1891 /*
1890 * current Port Speed 1892 * current Port Speed
1891 */ 1893 */
1892 attr = (struct fdmi_attr_s *) curr_ptr; 1894 attr = (struct fdmi_attr_s *) curr_ptr;
1893 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_PORT_SPEED); 1895 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_PORT_SPEED);
1894 attr->len = sizeof(fcs_port_attr.curr_speed); 1896 templen = sizeof(fcs_port_attr.curr_speed);
1895 memcpy(attr->value, &fcs_port_attr.curr_speed, attr->len); 1897 memcpy(attr->value, &fcs_port_attr.curr_speed, templen);
1896 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1898 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1897 len += attr->len; 1899 len += templen;
1898 ++count; 1900 ++count;
1899 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1901 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1900 sizeof(attr->len)); 1902 sizeof(templen));
1901 1903
1902 /* 1904 /*
1903 * max frame size 1905 * max frame size
1904 */ 1906 */
1905 attr = (struct fdmi_attr_s *) curr_ptr; 1907 attr = (struct fdmi_attr_s *) curr_ptr;
1906 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_FRAME_SIZE); 1908 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_FRAME_SIZE);
1907 attr->len = sizeof(fcs_port_attr.max_frm_size); 1909 templen = sizeof(fcs_port_attr.max_frm_size);
1908 memcpy(attr->value, &fcs_port_attr.max_frm_size, attr->len); 1910 memcpy(attr->value, &fcs_port_attr.max_frm_size, templen);
1909 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1911 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1910 len += attr->len; 1912 len += templen;
1911 ++count; 1913 ++count;
1912 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1914 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1913 sizeof(attr->len)); 1915 sizeof(templen));
1914 1916
1915 /* 1917 /*
1916 * OS Device Name 1918 * OS Device Name
@@ -1918,14 +1920,14 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
1918 if (fcs_port_attr.os_device_name[0] != '\0') { 1920 if (fcs_port_attr.os_device_name[0] != '\0') {
1919 attr = (struct fdmi_attr_s *) curr_ptr; 1921 attr = (struct fdmi_attr_s *) curr_ptr;
1920 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_DEV_NAME); 1922 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_DEV_NAME);
1921 attr->len = (u16) strlen(fcs_port_attr.os_device_name); 1923 templen = (u16) strlen(fcs_port_attr.os_device_name);
1922 memcpy(attr->value, fcs_port_attr.os_device_name, attr->len); 1924 memcpy(attr->value, fcs_port_attr.os_device_name, templen);
1923 attr->len = fc_roundup(attr->len, sizeof(u32)); 1925 templen = fc_roundup(templen, sizeof(u32));
1924 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1926 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1925 len += attr->len; 1927 len += templen;
1926 ++count; 1928 ++count;
1927 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1929 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1928 sizeof(attr->len)); 1930 sizeof(templen));
1929 } 1931 }
1930 /* 1932 /*
1931 * Host Name 1933 * Host Name
@@ -1933,14 +1935,14 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
1933 if (fcs_port_attr.host_name[0] != '\0') { 1935 if (fcs_port_attr.host_name[0] != '\0') {
1934 attr = (struct fdmi_attr_s *) curr_ptr; 1936 attr = (struct fdmi_attr_s *) curr_ptr;
1935 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_HOST_NAME); 1937 attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_HOST_NAME);
1936 attr->len = (u16) strlen(fcs_port_attr.host_name); 1938 templen = (u16) strlen(fcs_port_attr.host_name);
1937 memcpy(attr->value, fcs_port_attr.host_name, attr->len); 1939 memcpy(attr->value, fcs_port_attr.host_name, templen);
1938 attr->len = fc_roundup(attr->len, sizeof(u32)); 1940 templen = fc_roundup(templen, sizeof(u32));
1939 curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; 1941 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1940 len += attr->len; 1942 len += templen;
1941 ++count; 1943 ++count;
1942 attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + 1944 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1943 sizeof(attr->len)); 1945 sizeof(templen));
1944 } 1946 }
1945 1947
1946 /* 1948 /*
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 60f2ddf23ebc..f5b5cbba3f43 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -2594,7 +2594,7 @@ bfa_fcs_rport_set_del_timeout(u8 rport_tmo)
2594 bfa_fcs_rport_del_timeout = rport_tmo * 1000; 2594 bfa_fcs_rport_del_timeout = rport_tmo * 1000;
2595} 2595}
2596void 2596void
2597bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, u16 ox_id) 2597bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id)
2598{ 2598{
2599 bfa_trc(rport->fcs, rport->pid); 2599 bfa_trc(rport->fcs, rport->pid);
2600 2600
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 9f4aa391ea9d..9e82eea9b2b0 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -1683,7 +1683,8 @@ bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc)
1683static bfa_status_t 1683static bfa_status_t
1684bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz) 1684bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz)
1685{ 1685{
1686 u32 pgnum, loff, r32; 1686 u32 pgnum, loff;
1687 __be32 r32;
1687 int i, len; 1688 int i, len;
1688 u32 *buf = tbuf; 1689 u32 *buf = tbuf;
1689 1690
@@ -1909,7 +1910,7 @@ bfa_ioc_is_initialized(struct bfa_ioc_s *ioc)
1909void 1910void
1910bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg) 1911bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
1911{ 1912{
1912 u32 *msgp = mbmsg; 1913 __be32 *msgp = mbmsg;
1913 u32 r32; 1914 u32 r32;
1914 int i; 1915 int i;
1915 1916
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index eb1b005e5bc7..f8ac05081aa3 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -115,8 +115,8 @@ struct bfa_dma_s {
115static inline void 115static inline void
116__bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa) 116__bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa)
117{ 117{
118 dma_addr->a32.addr_lo = (u32) pa; 118 dma_addr->a32.addr_lo = (__be32) pa;
119 dma_addr->a32.addr_hi = (u32) (bfa_os_u32(pa)); 119 dma_addr->a32.addr_hi = (__be32) (bfa_os_u32(pa));
120} 120}
121 121
122 122
@@ -125,8 +125,8 @@ __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa)
125static inline void 125static inline void
126__bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) 126__bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa)
127{ 127{
128 dma_addr->a32.addr_lo = (u32) cpu_to_be32(pa); 128 dma_addr->a32.addr_lo = cpu_to_be32(pa);
129 dma_addr->a32.addr_hi = (u32) cpu_to_be32(bfa_os_u32(pa)); 129 dma_addr->a32.addr_hi = cpu_to_be32(bfa_os_u32(pa));
130} 130}
131 131
132struct bfa_ioc_regs_s { 132struct bfa_ioc_regs_s {
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index fff96226a383..35277cb9a9e5 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -29,7 +29,7 @@ static void
29bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) 29bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats)
30{ 30{
31 u32 *dip = (u32 *) stats; 31 u32 *dip = (u32 *) stats;
32 u32 t0, t1; 32 __be32 t0, t1;
33 int i; 33 int i;
34 34
35 for (i = 0; i < sizeof(union bfa_port_stats_u)/sizeof(u32); 35 for (i = 0; i < sizeof(union bfa_port_stats_u)/sizeof(u32);
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 37e16ac8f249..04b3349ad3a1 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -3127,7 +3127,7 @@ bfa_fcport_qos_stats_swap(struct bfa_qos_stats_s *d,
3127 struct bfa_qos_stats_s *s) 3127 struct bfa_qos_stats_s *s)
3128{ 3128{
3129 u32 *dip = (u32 *) d; 3129 u32 *dip = (u32 *) d;
3130 u32 *sip = (u32 *) s; 3130 __be32 *sip = (__be32 *) s;
3131 int i; 3131 int i;
3132 3132
3133 /* Now swap the 32 bit fields */ 3133 /* Now swap the 32 bit fields */
@@ -3140,7 +3140,7 @@ bfa_fcport_fcoe_stats_swap(struct bfa_fcoe_stats_s *d,
3140 struct bfa_fcoe_stats_s *s) 3140 struct bfa_fcoe_stats_s *s)
3141{ 3141{
3142 u32 *dip = (u32 *) d; 3142 u32 *dip = (u32 *) d;
3143 u32 *sip = (u32 *) s; 3143 __be32 *sip = (__be32 *) s;
3144 int i; 3144 int i;
3145 3145
3146 for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32)); 3146 for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32));
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h
index 58796d1284b7..27b33c765ddc 100644
--- a/drivers/scsi/bfa/bfi.h
+++ b/drivers/scsi/bfa/bfi.h
@@ -95,8 +95,8 @@ enum {
95 */ 95 */
96union bfi_addr_u { 96union bfi_addr_u {
97 struct { 97 struct {
98 u32 addr_lo; 98 __be32 addr_lo;
99 u32 addr_hi; 99 __be32 addr_hi;
100 } a32; 100 } a32;
101}; 101};
102 102
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h
index fa9f6fb9d45b..10288764439d 100644
--- a/drivers/scsi/bfa/bfi_ms.h
+++ b/drivers/scsi/bfa/bfi_ms.h
@@ -47,10 +47,10 @@ struct bfi_iocfc_cfg_s {
47 */ 47 */
48 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS]; 48 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
49 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS]; 49 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
50 u16 req_cq_elems[BFI_IOC_MAX_CQS]; 50 __be16 req_cq_elems[BFI_IOC_MAX_CQS];
51 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS]; 51 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
52 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS]; 52 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
53 u16 rsp_cq_elems[BFI_IOC_MAX_CQS]; 53 __be16 rsp_cq_elems[BFI_IOC_MAX_CQS];
54 54
55 union bfi_addr_u stats_addr; /* DMA-able address for stats */ 55 union bfi_addr_u stats_addr; /* DMA-able address for stats */
56 union bfi_addr_u cfgrsp_addr; /* config response dma address */ 56 union bfi_addr_u cfgrsp_addr; /* config response dma address */
@@ -102,8 +102,8 @@ struct bfi_iocfc_set_intr_req_s {
102 struct bfi_mhdr_s mh; /* common msg header */ 102 struct bfi_mhdr_s mh; /* common msg header */
103 u8 coalesce; /* enable intr coalescing */ 103 u8 coalesce; /* enable intr coalescing */
104 u8 rsvd[3]; 104 u8 rsvd[3];
105 u16 delay; /* delay timer 0..1125us */ 105 __be16 delay; /* delay timer 0..1125us */
106 u16 latency; /* latency timer 0..225us */ 106 __be16 latency; /* latency timer 0..225us */
107}; 107};
108 108
109 109
@@ -210,7 +210,7 @@ struct bfi_fcport_enable_req_s {
210 */ 210 */
211struct bfi_fcport_set_svc_params_req_s { 211struct bfi_fcport_set_svc_params_req_s {
212 struct bfi_mhdr_s mh; /* msg header */ 212 struct bfi_mhdr_s mh; /* msg header */
213 u16 tx_bbcredit; /* Tx credits */ 213 __be16 tx_bbcredit; /* Tx credits */
214 u16 rsvd; 214 u16 rsvd;
215}; 215};
216 216
@@ -231,7 +231,7 @@ struct bfi_fcport_trunk_link_s {
231 u8 state; /* bfa_trunk_link_state_t */ 231 u8 state; /* bfa_trunk_link_state_t */
232 u8 speed; /* bfa_port_speed_t */ 232 u8 speed; /* bfa_port_speed_t */
233 u8 rsvd; 233 u8 rsvd;
234 u32 deskew; 234 __be32 deskew;
235}; 235};
236 236
237#define BFI_FCPORT_MAX_LINKS 2 237#define BFI_FCPORT_MAX_LINKS 2
@@ -284,17 +284,17 @@ enum bfi_fcxp_i2h {
284 */ 284 */
285struct bfi_fcxp_send_req_s { 285struct bfi_fcxp_send_req_s {
286 struct bfi_mhdr_s mh; /* Common msg header */ 286 struct bfi_mhdr_s mh; /* Common msg header */
287 u16 fcxp_tag; /* driver request tag */ 287 __be16 fcxp_tag; /* driver request tag */
288 u16 max_frmsz; /* max send frame size */ 288 __be16 max_frmsz; /* max send frame size */
289 u16 vf_id; /* vsan tag if applicable */ 289 __be16 vf_id; /* vsan tag if applicable */
290 u16 rport_fw_hndl; /* FW Handle for the remote port */ 290 u16 rport_fw_hndl; /* FW Handle for the remote port */
291 u8 class; /* FC class used for req/rsp */ 291 u8 class; /* FC class used for req/rsp */
292 u8 rsp_timeout; /* timeout in secs, 0-no response */ 292 u8 rsp_timeout; /* timeout in secs, 0-no response */
293 u8 cts; /* continue sequence */ 293 u8 cts; /* continue sequence */
294 u8 lp_tag; /* lport tag */ 294 u8 lp_tag; /* lport tag */
295 struct fchs_s fchs; /* request FC header structure */ 295 struct fchs_s fchs; /* request FC header structure */
296 u32 req_len; /* request payload length */ 296 __be32 req_len; /* request payload length */
297 u32 rsp_maxlen; /* max response length expected */ 297 __be32 rsp_maxlen; /* max response length expected */
298 struct bfi_sge_s req_sge[BFA_FCXP_MAX_SGES]; /* request buf */ 298 struct bfi_sge_s req_sge[BFA_FCXP_MAX_SGES]; /* request buf */
299 struct bfi_sge_s rsp_sge[BFA_FCXP_MAX_SGES]; /* response buf */ 299 struct bfi_sge_s rsp_sge[BFA_FCXP_MAX_SGES]; /* response buf */
300}; 300};
@@ -304,11 +304,11 @@ struct bfi_fcxp_send_req_s {
304 */ 304 */
305struct bfi_fcxp_send_rsp_s { 305struct bfi_fcxp_send_rsp_s {
306 struct bfi_mhdr_s mh; /* Common msg header */ 306 struct bfi_mhdr_s mh; /* Common msg header */
307 u16 fcxp_tag; /* send request tag */ 307 __be16 fcxp_tag; /* send request tag */
308 u8 req_status; /* request status */ 308 u8 req_status; /* request status */
309 u8 rsvd; 309 u8 rsvd;
310 u32 rsp_len; /* actual response length */ 310 __be32 rsp_len; /* actual response length */
311 u32 residue_len; /* residual response length */ 311 __be32 residue_len; /* residual response length */
312 struct fchs_s fchs; /* response FC header structure */ 312 struct fchs_s fchs; /* response FC header structure */
313}; 313};
314 314
@@ -325,7 +325,7 @@ enum bfi_uf_i2h {
325struct bfi_uf_buf_post_s { 325struct bfi_uf_buf_post_s {
326 struct bfi_mhdr_s mh; /* Common msg header */ 326 struct bfi_mhdr_s mh; /* Common msg header */
327 u16 buf_tag; /* buffer tag */ 327 u16 buf_tag; /* buffer tag */
328 u16 buf_len; /* total buffer length */ 328 __be16 buf_len; /* total buffer length */
329 struct bfi_sge_s sge[BFA_UF_MAX_SGES]; /* buffer DMA SGEs */ 329 struct bfi_sge_s sge[BFA_UF_MAX_SGES]; /* buffer DMA SGEs */
330}; 330};
331 331
@@ -352,7 +352,7 @@ struct bfi_lps_login_req_s {
352 struct bfi_mhdr_s mh; /* common msg header */ 352 struct bfi_mhdr_s mh; /* common msg header */
353 u8 lp_tag; 353 u8 lp_tag;
354 u8 alpa; 354 u8 alpa;
355 u16 pdu_size; 355 __be16 pdu_size;
356 wwn_t pwwn; 356 wwn_t pwwn;
357 wwn_t nwwn; 357 wwn_t nwwn;
358 u8 fdisc; 358 u8 fdisc;
@@ -368,7 +368,7 @@ struct bfi_lps_login_rsp_s {
368 u8 lsrjt_expl; 368 u8 lsrjt_expl;
369 wwn_t port_name; 369 wwn_t port_name;
370 wwn_t node_name; 370 wwn_t node_name;
371 u16 bb_credit; 371 __be16 bb_credit;
372 u8 f_port; 372 u8 f_port;
373 u8 npiv_en; 373 u8 npiv_en;
374 u32 lp_pid:24; 374 u32 lp_pid:24;
@@ -427,7 +427,7 @@ enum bfi_rport_i2h_msgs {
427struct bfi_rport_create_req_s { 427struct bfi_rport_create_req_s {
428 struct bfi_mhdr_s mh; /* common msg header */ 428 struct bfi_mhdr_s mh; /* common msg header */
429 u16 bfa_handle; /* host rport handle */ 429 u16 bfa_handle; /* host rport handle */
430 u16 max_frmsz; /* max rcv pdu size */ 430 __be16 max_frmsz; /* max rcv pdu size */
431 u32 pid:24, /* remote port ID */ 431 u32 pid:24, /* remote port ID */
432 lp_tag:8; /* local port tag */ 432 lp_tag:8; /* local port tag */
433 u32 local_pid:24, /* local port ID */ 433 u32 local_pid:24, /* local port ID */
@@ -583,7 +583,7 @@ struct bfi_ioim_dif_s {
583 */ 583 */
584struct bfi_ioim_req_s { 584struct bfi_ioim_req_s {
585 struct bfi_mhdr_s mh; /* Common msg header */ 585 struct bfi_mhdr_s mh; /* Common msg header */
586 u16 io_tag; /* I/O tag */ 586 __be16 io_tag; /* I/O tag */
587 u16 rport_hdl; /* itnim/rport firmware handle */ 587 u16 rport_hdl; /* itnim/rport firmware handle */
588 struct fcp_cmnd_s cmnd; /* IO request info */ 588 struct fcp_cmnd_s cmnd; /* IO request info */
589 589
@@ -689,7 +689,7 @@ enum bfi_ioim_status {
689 */ 689 */
690struct bfi_ioim_rsp_s { 690struct bfi_ioim_rsp_s {
691 struct bfi_mhdr_s mh; /* common msg header */ 691 struct bfi_mhdr_s mh; /* common msg header */
692 u16 io_tag; /* completed IO tag */ 692 __be16 io_tag; /* completed IO tag */
693 u16 bfa_rport_hndl; /* releated rport handle */ 693 u16 bfa_rport_hndl; /* releated rport handle */
694 u8 io_status; /* IO completion status */ 694 u8 io_status; /* IO completion status */
695 u8 reuse_io_tag; /* IO tag can be reused */ 695 u8 reuse_io_tag; /* IO tag can be reused */
@@ -698,13 +698,13 @@ struct bfi_ioim_rsp_s {
698 u8 sns_len; /* scsi sense length */ 698 u8 sns_len; /* scsi sense length */
699 u8 resid_flags; /* IO residue flags */ 699 u8 resid_flags; /* IO residue flags */
700 u8 rsvd_a; 700 u8 rsvd_a;
701 u32 residue; /* IO residual length in bytes */ 701 __be32 residue; /* IO residual length in bytes */
702 u32 rsvd_b[3]; 702 u32 rsvd_b[3];
703}; 703};
704 704
705struct bfi_ioim_abort_req_s { 705struct bfi_ioim_abort_req_s {
706 struct bfi_mhdr_s mh; /* Common msg header */ 706 struct bfi_mhdr_s mh; /* Common msg header */
707 u16 io_tag; /* I/O tag */ 707 __be16 io_tag; /* I/O tag */
708 u16 abort_tag; /* unique request tag */ 708 u16 abort_tag; /* unique request tag */
709}; 709};
710 710
@@ -723,7 +723,7 @@ enum bfi_tskim_i2h {
723 723
724struct bfi_tskim_req_s { 724struct bfi_tskim_req_s {
725 struct bfi_mhdr_s mh; /* Common msg header */ 725 struct bfi_mhdr_s mh; /* Common msg header */
726 u16 tsk_tag; /* task management tag */ 726 __be16 tsk_tag; /* task management tag */
727 u16 itn_fhdl; /* itn firmware handle */ 727 u16 itn_fhdl; /* itn firmware handle */
728 lun_t lun; /* LU number */ 728 lun_t lun; /* LU number */
729 u8 tm_flags; /* see enum fcp_tm_cmnd */ 729 u8 tm_flags; /* see enum fcp_tm_cmnd */
@@ -733,7 +733,7 @@ struct bfi_tskim_req_s {
733 733
734struct bfi_tskim_abortreq_s { 734struct bfi_tskim_abortreq_s {
735 struct bfi_mhdr_s mh; /* Common msg header */ 735 struct bfi_mhdr_s mh; /* Common msg header */
736 u16 tsk_tag; /* task management tag */ 736 __be16 tsk_tag; /* task management tag */
737 u16 rsvd; 737 u16 rsvd;
738}; 738};
739 739
@@ -755,7 +755,7 @@ enum bfi_tskim_status {
755 755
756struct bfi_tskim_rsp_s { 756struct bfi_tskim_rsp_s {
757 struct bfi_mhdr_s mh; /* Common msg header */ 757 struct bfi_mhdr_s mh; /* Common msg header */
758 u16 tsk_tag; /* task mgmt cmnd tag */ 758 __be16 tsk_tag; /* task mgmt cmnd tag */
759 u8 tsk_status; /* @ref bfi_tskim_status */ 759 u8 tsk_status; /* @ref bfi_tskim_status */
760 u8 rsvd; 760 u8 rsvd;
761}; 761};