diff options
author | Maggie Zhang <xmzhang@brocade.com> | 2010-12-09 19:12:32 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 12:32:56 -0600 |
commit | f16a17507b09e10e0cccc4d675ccbfe030d51ef1 (patch) | |
tree | 4ead59bd8bfbd06f22dd18040b713fca998e1336 /drivers/scsi | |
parent | f314878ab95d4802ddde066096f7b30087cea7ba (diff) |
[SCSI] bfa: remove all OS wrappers
Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.
Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
28 files changed, 210 insertions, 304 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h index 8f17186a8df..cabc6b92b25 100644 --- a/drivers/scsi/bfa/bfa.h +++ b/drivers/scsi/bfa/bfa.h @@ -17,7 +17,7 @@ #ifndef __BFA_H__ #define __BFA_H__ -#include "bfa_os_inc.h" +#include "bfad_drv.h" #include "bfa_cs.h" #include "bfa_plog.h" #include "bfa_defs_svc.h" diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index d417864227c..02a5e04e365 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c @@ -15,9 +15,9 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" #include "bfi_ctreg.h" -#include "bfad_drv.h" BFA_TRC_FILE(HAL, CORE); diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h index 99f242b9aa3..493009d880a 100644 --- a/drivers/scsi/bfa/bfa_cs.h +++ b/drivers/scsi/bfa/bfa_cs.h @@ -22,7 +22,7 @@ #ifndef __BFA_CS_H__ #define __BFA_CS_H__ -#include "bfa_os_inc.h" +#include "bfad_drv.h" /* * BFA TRC @@ -32,12 +32,20 @@ #define BFA_TRC_MAX (4 * 1024) #endif +#define BFA_TRC_TS(_trcm) \ + ({ \ + struct timeval tv; \ + \ + do_gettimeofday(&tv); \ + (tv.tv_sec*1000000+tv.tv_usec); \ + }) + #ifndef BFA_TRC_TS #define BFA_TRC_TS(_trcm) ((_trcm)->ticks++) #endif struct bfa_trc_s { -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u16 fileno; u16 line; #else @@ -361,4 +369,43 @@ bfa_wc_wait(struct bfa_wc_s *wc) bfa_wc_down(wc); } +static inline void +wwn2str(char *wwn_str, u64 wwn) +{ + union { + u64 wwn; + u8 byte[8]; + } w; + + w.wwn = wwn; + sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", w.byte[0], + w.byte[1], w.byte[2], w.byte[3], w.byte[4], w.byte[5], + w.byte[6], w.byte[7]); +} + +static inline void +fcid2str(char *fcid_str, u32 fcid) +{ + union { + u32 fcid; + u8 byte[4]; + } f; + + f.fcid = fcid; + sprintf(fcid_str, "%02x:%02x:%02x", f.byte[1], f.byte[2], f.byte[3]); +} + +#define bfa_swap_3b(_x) \ + ((((_x) & 0xff) << 16) | \ + ((_x) & 0x00ff00) | \ + (((_x) & 0xff0000) >> 16)) + +#ifndef __BIG_ENDIAN +#define bfa_hton3b(_x) bfa_swap_3b(_x) +#else +#define bfa_hton3b(_x) (_x) +#endif + +#define bfa_ntoh3b(_x) bfa_hton3b(_x) + #endif /* __BFA_CS_H__ */ diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h index 07b57c4208c..d85f93aea46 100644 --- a/drivers/scsi/bfa/bfa_defs.h +++ b/drivers/scsi/bfa/bfa_defs.h @@ -19,7 +19,7 @@ #define __BFA_DEFS_H__ #include "bfa_fc.h" -#include "bfa_os_inc.h" +#include "bfad_drv.h" #define BFA_MFG_SERIALNUM_SIZE 11 #define STRSZ(_n) (((_n) + 4) & ~3) diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h index 104a17f70b5..0d04ba9574f 100644 --- a/drivers/scsi/bfa/bfa_fc.h +++ b/drivers/scsi/bfa/bfa_fc.h @@ -18,7 +18,7 @@ #ifndef __BFA_FC_H__ #define __BFA_FC_H__ -#include "bfa_os_inc.h" +#include "bfad_drv.h" typedef u64 wwn_t; @@ -62,7 +62,7 @@ struct scsi_cdb_s { * Fibre Channel Header Structure (FCHS) definition */ struct fchs_s { -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 routing:4; /* routing bits */ u32 cat_info:4; /* category info */ #else @@ -317,7 +317,7 @@ struct fc_plogi_csp_s { u8 verlo; /* FC-PH low version */ __be16 bbcred; /* BB_Credit */ -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u8 ciro:1, /* continuously increasing RO */ rro:1, /* random relative offset */ npiv_supp:1, /* NPIV supported */ @@ -367,7 +367,7 @@ struct fc_plogi_csp_s { * FC-PH-x. Figure 78. pg. 318. */ struct fc_plogi_clp_s { -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 class_valid:1; u32 intermix:1; /* class intermix supported if set =1. * valid only for class1. Reserved for @@ -532,7 +532,7 @@ struct fc_rsi_s { */ struct fc_prli_params_s { u32 reserved:16; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 reserved1:5; u32 rec_support:1; u32 task_retry_id:1; @@ -574,7 +574,7 @@ enum { struct fc_prli_params_page_s { u32 type:8; u32 codext:8; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 origprocasv:1; u32 rsppav:1; u32 imagepair:1; @@ -610,7 +610,7 @@ struct fc_prli_s { struct fc_prlo_params_page_s { u32 type:8; u32 type_ext:8; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 opa_valid:1; /* originator process associator * valid */ @@ -646,7 +646,7 @@ struct fc_prlo_acc_params_page_s { u32 type:8; u32 type_ext:8; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 opa_valid:1; /* originator process associator * valid */ @@ -803,7 +803,7 @@ struct fc_tprlo_params_page_s { u32 type:8; u32 type_ext:8; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u32 opa_valid:1; u32 rpa_valid:1; u32 tpo_nport_valid:1; @@ -1177,7 +1177,7 @@ struct fc_srr_s { struct fcp_cmnd_s { struct scsi_lun lun; /* 64-bit LU number */ u8 crn; /* command reference number */ -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u8 resvd:1, priority:4, /* FCP-3: SAM-3 priority */ taskattr:3; /* scsi task attribute */ @@ -1187,7 +1187,7 @@ struct fcp_cmnd_s { resvd:1; #endif u8 tm_flags; /* task management flags */ -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u8 addl_cdb_len:6, /* additional CDB length words */ iodir:2; /* read/write FCP_DATA IUs */ #else @@ -1273,7 +1273,7 @@ struct fcp_rspinfo_s { struct fcp_resp_s { u32 reserved[2]; /* 2 words reserved */ u16 reserved2; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN u8 reserved3:3; u8 fcp_conf_req:1; /* FCP_CONF is requested */ u8 resid_flags:2; /* underflow/overflow */ diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c index 322b11e10d6..1ca5af75dd3 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.c +++ b/drivers/scsi/bfa/bfa_fcbuild.c @@ -18,7 +18,7 @@ * fcbuild.c - FC link service frame building and parsing routines */ -#include "bfa_os_inc.h" +#include "bfad_drv.h" #include "bfa_fcbuild.h" /* @@ -48,7 +48,7 @@ fcbuild_init(void) fc_els_req_tmpl.cat_info = FC_CAT_LD_REQUEST; fc_els_req_tmpl.type = FC_TYPE_ELS; fc_els_req_tmpl.f_ctl = - bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | + bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); fc_els_req_tmpl.rx_id = FC_RXID_ANY; @@ -59,7 +59,7 @@ fcbuild_init(void) fc_els_rsp_tmpl.cat_info = FC_CAT_LD_REPLY; fc_els_rsp_tmpl.type = FC_TYPE_ELS; fc_els_rsp_tmpl.f_ctl = - bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | + bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); fc_els_rsp_tmpl.rx_id = FC_RXID_ANY; @@ -68,7 +68,7 @@ fcbuild_init(void) */ fc_bls_req_tmpl.routing = FC_RTG_BASIC_LINK; fc_bls_req_tmpl.type = FC_TYPE_BLS; - fc_bls_req_tmpl.f_ctl = bfa_os_hton3b(FCTL_END_SEQ | FCTL_SI_XFER); + fc_bls_req_tmpl.f_ctl = bfa_hton3b(FCTL_END_SEQ | FCTL_SI_XFER); fc_bls_req_tmpl.rx_id = FC_RXID_ANY; /* @@ -78,7 +78,7 @@ fcbuild_init(void) fc_bls_rsp_tmpl.cat_info = FC_CAT_BA_ACC; fc_bls_rsp_tmpl.type = FC_TYPE_BLS; fc_bls_rsp_tmpl.f_ctl = - bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | + bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); fc_bls_rsp_tmpl.rx_id = FC_RXID_ANY; @@ -129,7 +129,7 @@ fcbuild_init(void) fcp_fchs_tmpl.cat_info = FC_CAT_UNSOLICIT_CMD; fcp_fchs_tmpl.type = FC_TYPE_FCP; fcp_fchs_tmpl.f_ctl = - bfa_os_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); + bfa_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); fcp_fchs_tmpl.seq_id = 1; fcp_fchs_tmpl.rx_id = FC_RXID_ANY; } @@ -143,7 +143,7 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id) fchs->cat_info = FC_CAT_UNSOLICIT_CTRL; fchs->type = FC_TYPE_SERVICES; fchs->f_ctl = - bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | + bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); fchs->rx_id = FC_RXID_ANY; fchs->d_id = (d_id); @@ -232,7 +232,7 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, u8 set_npiv, u8 set_auth, u16 local_bb_credits) { - u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); + u32 d_id = bfa_hton3b(FC_FABRIC_PORT); __be32 *vvl_info; memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); @@ -289,7 +289,7 @@ u16 fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size) { - u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); + u32 d_id = bfa_hton3b(FC_FABRIC_PORT); memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); @@ -770,10 +770,10 @@ u16 fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id, u32 s_id, u32 *pid_list, u16 npids) { - u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_os_hton3b(d_id)); + u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_hton3b(d_id)); int i = 0; - fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0); + fc_els_req_build(fchs, bfa_hton3b(dctlr_id), s_id, 0); memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s)); @@ -1045,7 +1045,7 @@ fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_GID_PN); @@ -1061,7 +1061,7 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; fcgs_gpnid_req_t *gpnid = (fcgs_gpnid_req_t *) (cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_GPN_ID); @@ -1077,7 +1077,7 @@ fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; fcgs_gnnid_req_t *gnnid = (fcgs_gnnid_req_t *) (cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID); @@ -1104,7 +1104,7 @@ u16 fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, u8 set_br_reg, u32 s_id, u16 ox_id) { - u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); + u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER); fc_els_req_build(fchs, d_id, s_id, ox_id); @@ -1121,7 +1121,7 @@ u16 fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, u32 s_id, u16 ox_id) { - u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); + u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER); u16 payldlen; fc_els_req_build(fchs, d_id, s_id, ox_id); @@ -1143,7 +1143,7 @@ fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); - u32 type_value, d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 type_value, d_id = bfa_hton3b(FC_NAME_SERVER); u8 index; fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); @@ -1167,7 +1167,7 @@ fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID); @@ -1187,7 +1187,7 @@ fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rffid_req_s *rffid = (struct fcgs_rffid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_RFF_ID); @@ -1209,7 +1209,7 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rspnid_req_s *rspnid = (struct fcgs_rspnid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); fc_gs_cthdr_build(cthdr, s_id, GS_RSPN_ID); @@ -1229,7 +1229,7 @@ fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, u8 fc4_type) struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_gidft_req_s *gidft = (struct fcgs_gidft_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); @@ -1249,7 +1249,7 @@ fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rpnid_req_s *rpnid = (struct fcgs_rpnid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID); @@ -1267,7 +1267,7 @@ fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rnnid_req_s *rnnid = (struct fcgs_rnnid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_cthdr_build(cthdr, s_id, GS_RNN_ID); @@ -1286,7 +1286,7 @@ fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rcsid_req_s *rcsid = (struct fcgs_rcsid_req_s *) (cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID); @@ -1304,7 +1304,7 @@ fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_rptid_req_s *rptid = (struct fcgs_rptid_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID); @@ -1321,7 +1321,7 @@ fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id) { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; struct fcgs_ganxt_req_s *ganxt = (struct fcgs_ganxt_req_s *)(cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); + u32 d_id = bfa_hton3b(FC_NAME_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT); @@ -1341,7 +1341,7 @@ fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id, { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_fdmi_cthdr_build(cthdr, s_id, cmd_code); @@ -1377,7 +1377,7 @@ fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; fcgs_gmal_req_t *gmal = (fcgs_gmal_req_t *) (cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GMAL_CMD, @@ -1397,7 +1397,7 @@ fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) { struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; fcgs_gfn_req_t *gfn = (fcgs_gfn_req_t *) (cthdr + 1); - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); fc_gs_fchdr_build(fchs, d_id, s_id, 0); fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GFN_CMD, diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h index 1737e08e1c0..ece51ec7620 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.h +++ b/drivers/scsi/bfa/bfa_fcbuild.h @@ -21,7 +21,7 @@ #ifndef __FCBUILD_H__ #define __FCBUILD_H__ -#include "bfa_os_inc.h" +#include "bfad_drv.h" #include "bfa_fc.h" #include "bfa_defs_fcs.h" diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index 455c4f4e1d3..506f1d326e5 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c @@ -15,8 +15,8 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" -#include "bfa_os_inc.h" BFA_TRC_FILE(HAL, FCPIM); BFA_MODULE(fcpim); @@ -1560,24 +1560,6 @@ bfa_itnim_hold_io(struct bfa_itnim_s *itnim) bfa_sm_cmp_state(itnim, bfa_itnim_sm_iocdisable)); } -bfa_status_t -bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim, - struct bfa_itnim_ioprofile_s *ioprofile) -{ - struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(itnim->bfa); - if (!fcpim->io_profile) - return BFA_STATUS_IOPROFILE_OFF; - - itnim->ioprofile.index = BFA_IOBUCKET_MAX; - itnim->ioprofile.io_profile_start_time = - bfa_io_profile_start_time(itnim->bfa); - itnim->ioprofile.clock_res_mul = bfa_io_lat_clock_res_mul; - itnim->ioprofile.clock_res_div = bfa_io_lat_clock_res_div; - *ioprofile = itnim->ioprofile; - - return BFA_STATUS_OK; -} - void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim) { @@ -2352,7 +2334,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) scsi_for_each_sg(cmnd, sg, ioim->nsges, i) { if (i == 0) { /* build inline IO SG element */ - addr = bfa_os_sgaddr(sg_dma_address(sg)); + addr = bfa_sgaddr_le(sg_dma_address(sg)); sge->sga = *(union bfi_addr_u *) &addr; pgdlen = sg_dma_len(sg); sge->sg_len = pgdlen; @@ -2364,7 +2346,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) if (sge_id == 0) sgpge = sgpg->sgpg->sges; - addr = bfa_os_sgaddr(sg_dma_address(sg)); + addr = bfa_sgaddr_le(sg_dma_address(sg)); sgpge->sga = *(union bfi_addr_u *) &addr; sgpge->sg_len = sg_dma_len(sg); pgcumsz += sgpge->sg_len; diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index 141215c5163..e3a41b88a11 100644 --- a/drivers/scsi/bfa/bfa_fcs.c +++ b/drivers/scsi/bfa/bfa_fcs.c @@ -19,9 +19,9 @@ * bfa_fcs.c BFA FCS main */ +#include "bfad_drv.h" #include "bfa_fcs.h" #include "bfa_fcbuild.h" -#include "bfad_drv.h" BFA_TRC_FILE(FCS, FCS); @@ -1097,7 +1097,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, * external loopback cable is in place. Our own FLOGI frames are * sometimes looped back when switch port gets temporarily bypassed. */ - if ((pid == bfa_os_ntoh3b(FC_FABRIC_PORT)) && + if ((pid == bfa_ntoh3b(FC_FABRIC_PORT)) && (els_cmd->els_code == FC_ELS_FLOGI) && (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) { bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOOPBACK); @@ -1107,7 +1107,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, /* * FLOGI/EVFP exchanges should be consumed by base fabric. */ - if (fchs->d_id == bfa_os_hton3b(FC_FABRIC_PORT)) { + if (fchs->d_id == bfa_hton3b(FC_FABRIC_PORT)) { bfa_trc(fabric->fcs, pid); bfa_fcs_fabric_process_uf(fabric, fchs, len); return; @@ -1220,7 +1220,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) return; reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), - bfa_os_hton3b(FC_FABRIC_PORT), + bfa_hton3b(FC_FABRIC_PORT), n2n_port->reply_oxid, pcfg->pwwn, pcfg->nwwn, bfa_fcport_get_maxfrsize(bfa), diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index e7977ee3299..f0e652b5099 100644 --- a/drivers/scsi/bfa/bfa_fcs.h +++ b/drivers/scsi/bfa/bfa_fcs.h @@ -61,7 +61,7 @@ struct bfa_fcs_s; #define N2N_LOCAL_PID 0x010000 #define N2N_REMOTE_PID 0x020000 #define BFA_FCS_RETRY_TIMEOUT 2000 -#define BFA_FCS_PID_IS_WKA(pid) ((bfa_os_ntoh3b(pid) > 0xFFF000) ? 1 : 0) +#define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0) diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c index 82ac2798c54..5736ef8c592 100644 --- a/drivers/scsi/bfa/bfa_fcs_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c @@ -19,9 +19,9 @@ * fcpim.c - FCP initiator mode i-t nexus state machine */ +#include "bfad_drv.h" #include "bfa_fcs.h" #include "bfa_fcbuild.h" -#include "bfad_drv.h" #include "bfad_im.h" BFA_TRC_FILE(FCS, FCPIM); diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 6e9151fecb7..7a2cf7713a9 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c @@ -15,10 +15,10 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_fcs.h" #include "bfa_fcbuild.h" #include "bfa_fc.h" -#include "bfad_drv.h" BFA_TRC_FILE(FCS, PORT); @@ -2818,7 +2818,7 @@ bfa_fcs_lport_ms_send_plogi(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced) ms->fcxp = fcxp; len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), - bfa_os_hton3b(FC_MGMT_SERVER), + bfa_hton3b(FC_MGMT_SERVER), bfa_fcs_lport_get_fcid(port), 0, port->port_cfg.pwwn, port->port_cfg.nwwn, bfa_fcport_get_maxfrsize(port->fcs->bfa)); @@ -3575,7 +3575,7 @@ fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs); ns->fcxp = fcxp; len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), - bfa_os_hton3b(FC_NAME_SERVER), + bfa_hton3b(FC_NAME_SERVER), bfa_fcs_lport_get_fcid(port), 0, port->port_cfg.pwwn, port->port_cfg.nwwn, bfa_fcport_get_maxfrsize(port->fcs->bfa)); @@ -4654,7 +4654,7 @@ bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, int index, while ((qe != qh) && (i < nrports)) { rport = (struct bfa_fcs_rport_s *) qe; - if (bfa_os_ntoh3b(rport->pid) > 0xFFF000) { + if (bfa_ntoh3b(rport->pid) > 0xFFF000) { qe = bfa_q_next(qe); bfa_trc(fcs, (u32) rport->pwwn); bfa_trc(fcs, rport->pid); @@ -4702,7 +4702,7 @@ bfa_fcs_lport_get_rports(struct bfa_fcs_lport_s *port, while ((qe != qh) && (i < *nrports)) { rport = (struct bfa_fcs_rport_s *) qe; - if (bfa_os_ntoh3b(rport->pid) > 0xFFF000) { + if (bfa_ntoh3b(rport->pid) > 0xFFF000) { qe = bfa_q_next(qe); bfa_trc(fcs, (u32) rport->pwwn); bfa_trc(fcs, rport->pid); @@ -4753,7 +4753,7 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port) while (qe != qh) { rport = (struct bfa_fcs_rport_s *) qe; - if ((bfa_os_ntoh3b(rport->pid) > 0xFFF000) || + if ((bfa_ntoh3b(rport->pid) > 0xFFF000) || (bfa_fcs_rport_get_state(rport) == BFA_RPORT_OFFLINE)) { qe = bfa_q_next(qe); diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c index 2089d686fa5..fbfcac7615b 100644 --- a/drivers/scsi/bfa/bfa_fcs_rport.c +++ b/drivers/scsi/bfa/bfa_fcs_rport.c @@ -19,9 +19,9 @@ * rport.c Remote port implementation. */ +#include "bfad_drv.h" #include "bfa_fcs.h" #include "bfa_fcbuild.h" -#include "bfad_drv.h" BFA_TRC_FILE(FCS, RPORT); diff --git a/drivers/scsi/bfa/bfa_hw_cb.c b/drivers/scsi/bfa/bfa_hw_cb.c index d8464ae6007..1fa15edabcd 100644 --- a/drivers/scsi/bfa/bfa_hw_cb.c +++ b/drivers/scsi/bfa/bfa_hw_cb.c @@ -15,6 +15,7 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" #include "bfi_cbreg.h" diff --git a/drivers/scsi/bfa/bfa_hw_ct.c b/drivers/scsi/bfa/bfa_hw_ct.c index b0efbc713ff..68077c4c4d5 100644 --- a/drivers/scsi/bfa/bfa_hw_ct.c +++ b/drivers/scsi/bfa/bfa_hw_ct.c @@ -15,6 +15,7 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" #include "bfi_ctreg.h" diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index a8f745420f3..cd532444ffd 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c @@ -15,11 +15,11 @@ * General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_ioc.h" #include "bfi_ctreg.h" #include "bfa_defs.h" #include "bfa_defs_svc.h" -#include "bfad_drv.h" BFA_TRC_FILE(CNA, IOC); @@ -1428,12 +1428,12 @@ static void bfa_ioc_send_enable(struct bfa_ioc_s *ioc) { struct bfi_ioc_ctrl_req_s enable_req; - struct bfa_timeval_s tv; + struct timeval tv; bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ, bfa_ioc_portid(ioc)); enable_req.ioc_class = ioc->ioc_mc; - bfa_os_gettimeofday(&tv); + do_gettimeofday(&tv); enable_req.tv_sec = be32_to_cpu(tv.tv_sec); bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s)); } diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 3c5bdd1c0c7..62153f28321 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h @@ -18,7 +18,7 @@ #ifndef __BFA_IOC_H__ #define __BFA_IOC_H__ -#include "bfa_os_inc.h" +#include "bfad_drv.h" #include "bfa_cs.h" #include "bfi.h" @@ -74,7 +74,7 @@ struct bfa_sge_s { #define bfa_swap_words(_x) ( \ ((_x) << 32) | ((_x) >> 32)) -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN #define bfa_sge_to_be(_x) #define bfa_sge_to_le(_x) bfa_sge_word_swap(_x) #define bfa_sgaddr_le(_x) bfa_swap_words(_x) @@ -120,7 +120,7 @@ static inline void __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa) { dma_addr->a32.addr_lo = (__be32) pa; - dma_addr->a32.addr_hi = (__be32) (bfa_os_u32(pa)); + dma_addr->a32.addr_hi = (__be32) (pa >> 32); } @@ -130,7 +130,7 @@ static inline void __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) { dma_addr->a32.addr_lo = cpu_to_be32(pa); - dma_addr->a32.addr_hi = cpu_to_be32(bfa_os_u32(pa)); + dma_addr->a32.addr_hi |