diff options
author | Maggie <xmzhang@brocade.com> | 2010-11-29 18:26:32 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 12:24:17 -0600 |
commit | 50444a340028119ce5ba45d60b4cf44e3e6e1b32 (patch) | |
tree | a1030723aaa84cc07f37f8c3d76766f8a9f1f19a /drivers/scsi/bfa | |
parent | 52f94b6fd0d1ff9d935c52f8a6360834ed871d92 (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.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 8 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fc.h | 56 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcbuild.c | 44 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcbuild.h | 28 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.h | 14 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_lport.c | 226 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_rport.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 5 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 8 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_port.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfi.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfi_ms.h | 50 |
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 6f021015f1f..afb573878e2 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 bfad_int_to_lun(u32 luno) { union { - u16 scsi_lun[4]; + __be16 scsi_lun[4]; lun_t bfa_lun; } lun; diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index e24e9f7ca81..648c8417672 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h @@ -34,8 +34,8 @@ struct bfa_iocfc_intr_attr_s { u8 coalesce; /* enable/disable coalescing */ u8 rsvd[3]; - u16 latency; /* latency in microseconds */ - u16 delay; /* delay in microseconds */ + __be16 latency; /* latency in microseconds */ + __be16 delay; /* delay in microseconds */ }; /* @@ -743,7 +743,7 @@ struct bfa_port_cfg_s { u8 qos_enabled; /* qos enabled or not */ u8 cfg_hardalpa; /* is hard alpa configured */ u8 hardalpa; /* configured hard alpa */ - u16 maxfrsize; /* maximum frame size */ + __be16 maxfrsize; /* maximum frame size */ u8 rx_bbcredit; /* receive buffer credits */ u8 tx_bbcredit; /* transmit buffer credits */ u8 ratelimit; /* ratelimit enabled or not */ @@ -843,7 +843,7 @@ struct bfa_fcport_fcf_s { u8 fka_disabled; /* FKA is disabled */ u8 maxsz_verified; /* FCoE max size verified */ u8 fc_map[3]; /* FC map */ - u16 vlan; /* FCoE vlan tag/priority */ + __be16 vlan; /* FCoE vlan tag/priority */ u32 fka_adv_per; /* FIP ka advert. period */ mac_t mac; /* FCF mac */ }; diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h index e929d25b09e..ce5274a017f 100644 --- a/drivers/scsi/bfa/bfa_fc.h +++ b/drivers/scsi/bfa/bfa_fc.h @@ -82,7 +82,7 @@ struct fchs_s { u8 df_ctl; /* data field control */ u16 seq_cnt; /* sequence count */ - u16 ox_id; /* originator exchange ID */ + __be16 ox_id; /* originator exchange ID */ u16 rx_id; /* responder exchange ID */ u32 ro; /* relative offset */ @@ -316,7 +316,7 @@ enum { struct fc_plogi_csp_s { u8 verhi; /* FC-PH high version */ u8 verlo; /* FC-PH low version */ - u16 bbcred; /* BB_Credit */ + __be16 bbcred; /* BB_Credit */ #ifdef __BIGENDIAN u8 ciro:1, /* continuously increasing RO */ @@ -355,12 +355,12 @@ struct fc_plogi_csp_s { hg_supp:1; #endif - u16 rxsz; /* recieve data_field size */ + __be16 rxsz; /* recieve data_field size */ - u16 conseq; - u16 ro_bitmap; + __be16 conseq; + __be16 ro_bitmap; - u32 e_d_tov; + __be32 e_d_tov; }; /* @@ -873,7 +873,7 @@ struct fc_rscn_event_s { struct fc_rscn_pl_s { u8 command; u8 pagelen; - u16 payldlen; + __be16 payldlen; struct fc_rscn_event_s event[1]; }; @@ -926,9 +926,9 @@ struct fc_rnid_common_id_data_s { struct fc_rnid_general_topology_data_s { u32 vendor_unique[4]; - u32 asso_type; + __be32 asso_type; u32 phy_port_num; - u32 num_attached_nodes; + __be32 num_attached_nodes; u32 node_mgmt:8; u32 ip_version:8; u32 udp_tcp_port_num:16; @@ -984,8 +984,8 @@ enum fc_rpsc_op_speed { }; struct fc_rpsc_speed_info_s { - u16 port_speed_cap; /*! see enum fc_rpsc_speed_cap */ - u16 port_op_speed; /*! see enum fc_rpsc_op_speed */ + __be16 port_speed_cap; /*! see enum fc_rpsc_speed_cap */ + __be16 port_op_speed; /*! see enum fc_rpsc_op_speed */ }; enum link_e2e_beacon_subcmd { @@ -1056,9 +1056,9 @@ struct fc_rpsc_acc_s { struct fc_rpsc2_cmd_s { struct fc_els_cmd_s els_cmd; - u32 token; + __be32 token; u16 resvd; - u16 num_pids; /* Number of pids in the request */ + __be16 num_pids; /* Number of pids in the request */ struct { u32 rsvd1:8; u32 pid:24; /* port identifier */ @@ -1076,12 +1076,12 @@ enum fc_rpsc2_port_type { * RPSC2 portInfo entry structure */ struct fc_rpsc2_port_info_s { - u32 pid; /* PID */ - u16 resvd1; - u16 index; /* port number / index */ - u8 resvd2; - u8 type; /* port type N/NL/... */ - u16 speed; /* port Operating Speed */ + __be32 pid; /* PID */ + u16 resvd1; + __be16 index; /* port number / index */ + u8 resvd2; + u8 type; /* port type N/NL/... */ + __be16 speed; /* port Operating Speed */ }; /* @@ -1090,7 +1090,7 @@ struct fc_rpsc2_port_info_s { struct fc_rpsc2_acc_s { u8 els_cmd; u8 resvd; - u16 num_pids; /* Number of pids in the request */ + __be16 num_pids; /* Number of pids in the request */ struct fc_rpsc2_port_info_s port_info[1]; /* port information */ }; @@ -1200,7 +1200,7 @@ struct fcp_cmnd_s { /* * !!! additional cdb bytes follows here!!! */ - u32 fcp_dl; /* bytes to be transferred */ + __be32 fcp_dl; /* bytes to be transferred */ }; #define fcp_cmnd_cdb_len(_cmnd) ((_cmnd)->addl_cdb_len * 4 + FCP_CMND_CDB_LEN) @@ -1469,7 +1469,7 @@ struct fcgs_gidpn_resp_s { struct fcgs_rftid_req_s { u32 rsvd:8; u32 dap:24; /* port identifier */ - u32 fc4_type[8]; /* fc4 types */ + __be32 fc4_type[8]; /* fc4 types */ }; /* @@ -1764,7 +1764,7 @@ struct fcgs_req_s { /* Accept Response to GMAL */ struct fcgs_gmal_resp_s { - u32 ms_len; /* Num of entries */ + __be32 ms_len; /* Num of entries */ u8 ms_ma[256]; }; @@ -1856,8 +1856,8 @@ enum fdmi_port_attribute_type { * FDMI attribute */ struct fdmi_attr_s { - u16 type; - u16 len; + __be16 type; + __be16 len; u8 value[1]; }; @@ -1865,7 +1865,7 @@ struct fdmi_attr_s { * HBA Attribute Block */ struct fdmi_hba_attr_s { - u32 attr_count; /* # of attributes */ + __be32 attr_count; /* # of attributes */ struct fdmi_attr_s hba_attr; /* n attributes */ }; @@ -1873,7 +1873,7 @@ struct fdmi_hba_attr_s { * Registered Port List */ struct fdmi_port_list_s { - u32 num_ports; /* number Of Port Entries */ + __be32 num_ports; /* number Of Port Entries */ wwn_t port_entry; /* one or more */ }; @@ -1881,7 +1881,7 @@ struct fdmi_port_list_s { * Port Attribute Block */ struct fdmi_port_attr_s { - u32 attr_count; /* # of attributes */ + __be32 attr_count; /* # of attributes */ struct fdmi_attr_s port_attr; /* n attributes */ }; diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c index 9c725314b51..322b11e10d6 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.c +++ b/drivers/scsi/bfa/bfa_fcbuild.c @@ -25,9 +25,9 @@ * static build functions */ static void fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, - u16 ox_id); + __be16 ox_id); static void fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, - u16 ox_id); + __be16 ox_id); static struct fchs_s fc_els_req_tmpl; static struct fchs_s fc_els_rsp_tmpl; static 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) } void -fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) +fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id) { memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s)); 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) } static void -fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) +fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id) { memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s)); fchs->d_id = d_id; @@ -196,7 +196,7 @@ fc_els_rsp_parse(struct fchs_s *fchs, int len) } static void -fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) +fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id) { memcpy(fchs, &fc_bls_rsp_tmpl, sizeof(struct fchs_s)); 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) static u16 fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, - u16 ox_id, wwn_t port_name, wwn_t node_name, + __be16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, u8 els_code) { 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, u8 set_npiv, u8 set_auth, u16 local_bb_credits) { u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); - u32 *vvl_info; + __be32 *vvl_info; memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); @@ -267,7 +267,7 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, u16 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, - u16 ox_id, wwn_t port_name, wwn_t node_name, + __be16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, u16 local_bb_credits) { u32 d_id = 0; @@ -392,7 +392,7 @@ fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, u16 fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, - u16 ox_id, enum bfa_lport_role role) + __be16 ox_id, enum bfa_lport_role role) { struct fc_prli_s *prli = (struct fc_prli_s *) (pld); @@ -458,7 +458,7 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id, static u16 fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, - u32 s_id, u16 ox_id, wwn_t port_name, + u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name, u8 els_code) { 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, u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, - u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name) + u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name) { return fc_adisc_x_build(fchs, adisc, d_id, s_id, ox_id, port_name, node_name, FC_ELS_ADISC); @@ -488,7 +488,7 @@ fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, u16 fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, - u32 s_id, u16 ox_id, wwn_t port_name, + u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name) { 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, u16 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, - u16 ox_id) + __be16 ox_id) { struct fc_els_cmd_s *acc = pld; @@ -606,7 +606,7 @@ fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, u16 fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id, - u32 s_id, u16 ox_id, u8 reason_code, + u32 s_id, __be16 ox_id, u8 reason_code, u8 reason_code_expl) { 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, u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, - u32 s_id, u16 ox_id, u16 rx_id) + u32 s_id, __be16 ox_id, u16 rx_id) { fc_bls_rsp_build(fchs, d_id, s_id, ox_id); @@ -638,7 +638,7 @@ fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, u16 fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, u32 d_id, - u32 s_id, u16 ox_id) + u32 s_id, __be16 ox_id) { fc_els_rsp_build(fchs, d_id, s_id, ox_id); 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) u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, - u32 d_id, u32 s_id, u16 ox_id, int num_pages) + u32 d_id, u32 s_id, __be16 ox_id, int num_pages) { int page; @@ -690,7 +690,7 @@ fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id, - u32 s_id, u16 ox_id, int num_pages) + u32 s_id, __be16 ox_id, int num_pages) { int page; @@ -728,7 +728,7 @@ fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id, u16 fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id, - u32 s_id, u16 ox_id, u32 data_format, + u32 s_id, __be16 ox_id, u32 data_format, struct fc_rnid_common_id_data_s *common_id_data, struct fc_rnid_general_topology_data_s *gen_topo_data) { @@ -788,7 +788,7 @@ fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id, u16 fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, - u32 d_id, u32 s_id, u16 ox_id, + u32 d_id, u32 s_id, __be16 ox_id, struct fc_rpsc_speed_info_s *oper_speed) { memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s)); @@ -995,7 +995,7 @@ fc_rrq_rsp_parse(struct fchs_s *fchs, int len) } u16 -fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, +fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id, u32 reason_code, u32 reason_expl) { struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1); @@ -1356,7 +1356,7 @@ void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask) { u8 index; - u32 *ptr = (u32 *) bit_mask; + __be32 *ptr = (__be32 *) bit_mask; u32 type_value; /* diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h index 73abd02e53c..1737e08e1c0 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, u16 pdu_size); u16 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, - u32 s_id, u16 ox_id, + u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, u16 local_bb_credits); @@ -186,7 +186,7 @@ u16 fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u16 pdu_size); u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, - u32 d_id, u32 s_id, u16 ox_id, wwn_t port_name, + u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name); enum 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, wwn_t port_name, wwn_t node_name); u16 fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, - u32 d_id, u32 s_id, u16 ox_id, + u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name, wwn_t node_name); u16 fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, - u32 d_id, u32 s_id, u16 ox_id, + u32 d_id, u32 s_id, __be16 ox_id, u8 reason_code, u8 reason_code_expl); u16 fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, - u32 d_id, u32 s_id, u16 ox_id); + u32 d_id, u32 s_id, __be16 ox_id); u16 fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, u16 ox_id); enum fc_parse_status fc_prli_rsp_parse(struct fc_prli_s *prli, int len); u16 fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, - u32 s_id, u16 ox_id, + u32 s_id, __be16 ox_id, enum bfa_lport_role role); u16 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, u16 fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id, u32 s_id, - u16 ox_id, u32 data_format, + __be16 ox_id, u32 data_format, struct fc_rnid_common_id_data_s *common_id_data, struct fc_rnid_general_topology_data_s *gen_topo_data); @@ -228,7 +228,7 @@ u16 fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc, u32 d_id, u32 s_id, u16 ox_id); u16 fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, u32 d_id, u32 s_id, - u16 ox_id, struct fc_rpsc_speed_info_s *oper_speed); + __be16 ox_id, struct fc_rpsc_speed_info_s *oper_speed); u16 fc_gid_ft_build(struct fchs_s *fchs, void *pld, u32 s_id, u8 fc4_type); @@ -251,7 +251,7 @@ u16 fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id, u16 ox_id, wwn_t port_name); u16 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, - u32 s_id, u16 ox_id); + u32 s_id, __be16 ox_id); u16 fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 cmd_code); @@ -261,7 +261,7 @@ u16 fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn); void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask); void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, - u16 ox_id); + __be16 ox_id); enum fc_parse_status fc_els_rsp_parse(struct fchs_s *fchs, int len); @@ -274,15 +274,15 @@ enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name); u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, - u32 s_id, u16 ox_id, u16 rx_id); + u32 s_id, __be16 ox_id, u16 rx_id); int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code); u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, - u32 d_id, u32 s_id, u16 ox_id, int num_pages); + u32 d_id, u32 s_id, __be16 ox_id, int num_pages); u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, - u32 d_id, u32 s_id, u16 ox_id, int num_pages); + u32 d_id, u32 s_id, __be16 ox_id, int num_pages); u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len); @@ -304,7 +304,7 @@ u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 fc_tprlo_rsp_parse(struct fchs_s *fchs, int len); u16 fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, - u16 ox_id, u32 reason_code, u32 reason_expl); + __be16 ox_id, u32 reason_code, u32 reason_expl); u16 fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, u32 port_id); diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index 9cb6a55977c..5a8b928f8db 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 { struct bfa_fcs_lport_n2n_s { u32 rsvd; - u16 reply_oxid; /* ox_id from the req flogi to be + __be16 reply_oxid; /* ox_id from the req flogi to be *used in flogi acc */ wwn_t rem_port_wwn; /* Attached port's wwn */ }; @@ -406,7 +406,7 @@ struct bfa_fcs_rport_s { struct bfad_rport_s *rp_drv; /* driver peer instance */ u32 pid; /* port ID of rport */ u16 maxfrsize; /* maximum frame size */ - u16 reply_oxid; /* OX_ID of inbound requests */ + __be16 reply_oxid; /* OX_ID of inbound requests */ enum fc_cos fc_cos; /* FC classes of service supp */ bfa_boolean_t cisc; /* CISC capable device */ bfa_boolean_t prlo; /* processing prlo or LOGO */ @@ -471,7 +471,7 @@ void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port, void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, struct fc_logi_s *plogi); void bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport); -void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, u16 ox_id); +void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id); void bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport); void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport); @@ -618,7 +618,7 @@ struct bfa_fcs_fdmi_hba_attr_s { u8 option_rom_ver[BFA_VERSION_LEN]; u8 fw_version[8]; u8 os_name[256]; - u32 max_ct_pyld; + __be32 max_ct_pyld; }; /* @@ -626,9 +626,9 @@ struct bfa_fcs_fdmi_hba_attr_s { */ struct bfa_fcs_fdmi_port_attr_s { u8 supp_fc4_types[32]; /* supported FC4 types */ - u32 supp_speed; /* supported speed */ - u32 curr_speed; /* current Speed */ - u32 max_frm_size; /* max frame size */ + __be32 supp_speed; /* supported speed */ + __be32 curr_speed; /* current Speed */ + __be32 max_frm_size; /* max frame size */ u8 os_device_name[256]; /* OS device Name */ u8 host_name[256]; /* host name */ }; diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 30665c74446..93c3588c715 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) struct fdmi_attr_s *attr; u8 *curr_ptr; u16 len, count; + u16 templen; /* * get hba attributes @@ -1594,69 +1595,69 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_NODENAME); - attr->len = sizeof(wwn_t); - memcpy(attr->value, &bfa_fcs_lport_get_nwwn(port), attr->len); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = sizeof(wwn_t); + memcpy(attr->value, &bfa_fcs_lport_get_nwwn(port), templen); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Manufacturer */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MANUFACTURER); - attr->len = (u16) strlen(fcs_hba_attr->manufacturer); - memcpy(attr->value, fcs_hba_attr->manufacturer, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->manufacturer); + memcpy(attr->value, fcs_hba_attr->manufacturer, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Serial Number */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_SERIALNUM); - attr->len = (u16) strlen(fcs_hba_attr->serial_num); - memcpy(attr->value, fcs_hba_attr->serial_num, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->serial_num); + memcpy(attr->value, fcs_hba_attr->serial_num, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Model */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL); - attr->len = (u16) strlen(fcs_hba_attr->model); - memcpy(attr->value, fcs_hba_attr->model, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->model); + memcpy(attr->value, fcs_hba_attr->model, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Model Desc */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MODEL_DESC); - attr->len = (u16) strlen(fcs_hba_attr->model_desc); - memcpy(attr->value, fcs_hba_attr->model_desc, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->model_desc); + memcpy(attr->value, fcs_hba_attr->model_desc, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * H/W Version @@ -1664,14 +1665,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) if (fcs_hba_attr->hw_version[0] != '\0') { attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_HW_VERSION); - attr->len = (u16) strlen(fcs_hba_attr->hw_version); - memcpy(attr->value, fcs_hba_attr->hw_version, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->hw_version); + memcpy(attr->value, fcs_hba_attr->hw_version, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); } /* @@ -1679,14 +1680,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_DRIVER_VERSION); - attr->len = (u16) strlen(fcs_hba_attr->driver_version); - memcpy(attr->value, fcs_hba_attr->driver_version, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len;; + templen = (u16) strlen(fcs_hba_attr->driver_version); + memcpy(attr->value, fcs_hba_attr->driver_version, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen;; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Option Rom Version @@ -1694,14 +1695,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) if (fcs_hba_attr->option_rom_ver[0] != '\0') { attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_ROM_VERSION); - attr->len = (u16) strlen(fcs_hba_attr->option_rom_ver); - memcpy(attr->value, fcs_hba_attr->option_rom_ver, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->option_rom_ver); + memcpy(attr->value, fcs_hba_attr->option_rom_ver, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); } /* @@ -1709,14 +1710,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); - attr->len = (u16) strlen(fcs_hba_attr->driver_version); - memcpy(attr->value, fcs_hba_attr->driver_version, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->driver_version); + memcpy(attr->value, fcs_hba_attr->driver_version, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * OS Name @@ -1724,14 +1725,14 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) if (fcs_hba_attr->os_name[0] != '\0') { attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_OS_NAME); - attr->len = (u16) strlen(fcs_hba_attr->os_name); - memcpy(attr->value, fcs_hba_attr->os_name, attr->len); - attr->len = fc_roundup(attr->len, sizeof(u32)); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = (u16) strlen(fcs_hba_attr->os_name); + memcpy(attr->value, fcs_hba_attr->os_name, templen); + templen = fc_roundup(templen, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); } /* @@ -1739,12 +1740,12 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_MAX_CT); - attr->len = sizeof(fcs_hba_attr->max_ct_pyld); - memcpy(attr->value, &fcs_hba_attr->max_ct_pyld, attr->len); - len += attr->len; + templen = sizeof(fcs_hba_attr->max_ct_pyld); + memcpy(attr->value, &fcs_hba_attr->max_ct_pyld, templen); + len += templen; count++; - attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + attr->len = cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Update size of payload @@ -1845,6 +1846,7 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *curr_ptr; u16 len; u8 count = 0; + u16 templen; /* * get port attributes @@ -1863,54 +1865,54 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi, */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_FC4_TYPES); - attr->len = sizeof(fcs_port_attr.supp_fc4_types); - memcpy(attr->value, fcs_port_attr.supp_fc4_types, attr->len); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = sizeof(fcs_port_attr.supp_fc4_types); + memcpy(attr->value, fcs_port_attr.supp_fc4_types, templen); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; ++count; attr->len = - cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); /* * Supported Speed */ attr = (struct fdmi_attr_s *) curr_ptr; attr->type = cpu_to_be16(FDMI_PORT_ATTRIB_SUPP_SPEED); - attr->len = sizeof(fcs_port_attr.supp_speed); - memcpy(attr->value, &fcs_port_attr.supp_speed, attr->len); - curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; - len += attr->len; + templen = sizeof(fcs_port_attr.supp_speed); + memcpy(attr->value, &fcs_port_attr.supp_speed, templen); + curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; + len += templen; ++count; attr->len = - cpu_to_be16(attr->len + sizeof(attr->type) + - sizeof(attr->len)); + cpu_to_be16(templen + sizeof(attr->type) + + sizeof(templen)); |