bfa: remove all OS wrappers
Subsystems (2)
PATCH 6/7 bfa: remove all OS wrappers
Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.
Signed-off-by Maggie Zhang <[email protected]>
Signed-off-by Jing Huang <[email protected]>
--- drivers/scsi/bfa/bfa.h | 2 +- drivers/scsi/bfa/bfa_core.c | 2 +- drivers/scsi/bfa/bfa_cs.h | 51 +++++++++++++- drivers/scsi/bfa/bfa_defs.h | 2 +- drivers/scsi/bfa/bfa_fc.h | 24 +++--- drivers/scsi/bfa/bfa_fcbuild.c | 58 ++++++++-------- drivers/scsi/bfa/bfa_fcbuild.h | 2 +- drivers/scsi/bfa/bfa_fcpim.c | 24 +------ drivers/scsi/bfa/bfa_fcs.c | 8 +- drivers/scsi/bfa/bfa_fcs.h | 2 +- drivers/scsi/bfa/bfa_fcs_fcpim.c | 2 +- drivers/scsi/bfa/bfa_fcs_lport.c | 12 ++-- drivers/scsi/bfa/bfa_fcs_rport.c | 2 +- drivers/scsi/bfa/bfa_hw_cb.c | 1 + drivers/scsi/bfa/bfa_hw_ct.c | 1 + drivers/scsi/bfa/bfa_ioc.c | 6 +- drivers/scsi/bfa/bfa_ioc.h | 8 +- drivers/scsi/bfa/bfa_ioc_cb.c | 1 + drivers/scsi/bfa/bfa_ioc_ct.c | 1 + drivers/scsi/bfa/bfa_os_inc.h | 143 -------------------------------------- drivers/scsi/bfa/bfa_port.c | 15 ++-- drivers/scsi/bfa/bfa_svc.c | 37 ++++++---- drivers/scsi/bfa/bfad.c | 9 +-- drivers/scsi/bfa/bfad_attr.c | 10 ++-- drivers/scsi/bfa/bfad_drv.h | 37 ++++++---- drivers/scsi/bfa/bfad_im.c | 38 +++++----- drivers/scsi/bfa/bfad_im.h | 16 ++-- drivers/scsi/bfa/bfi.h | 2 +- 28 files changed, 211 insertions(+), 305 deletions(-) delete mode 100644 drivers/scsi/bfa/bfa_os_inc.h
drivers/scsi/bfa/bfa.h +1 -1
@@ -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"
drivers/scsi/bfa/bfa_core.c +1 -1
@@ -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 );
drivers/scsi/bfa/bfa_cs.h +49 -2
72 lines not on this page · raw message
drivers/scsi/bfa/bfa_defs.h +1 -1
@@ -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)
drivers/scsi/bfa/bfa_fc.h +12 -12
@@ -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_ENDIANu32 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_ENDIANu32 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_ENDIANu32 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_ENDIANu32 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_ENDIANu32 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_ENDIANu8 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_ENDIANu8 reserved3:3 ;u8 fcp_conf_req:1 ;/* FCP_CONF is requested */ u8 resid_flags:2 ;/* underflow/overflow */
drivers/scsi/bfa/bfa_fcbuild.c +29 -29
228 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcbuild.h +1 -1
@@ -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"
drivers/scsi/bfa/bfa_fcpim.c +3 -21
@@ -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;
drivers/scsi/bfa/bfa_fcs.c +4 -4
@@ -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),
drivers/scsi/bfa/bfa_fcs.h +1 -1
@@ -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)
drivers/scsi/bfa/bfa_fcs_fcpim.c +1 -1
@@ -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 );
drivers/scsi/bfa/bfa_fcs_lport.c +6 -6
@@ -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);
drivers/scsi/bfa/bfa_fcs_rport.c +1 -1
@@ -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 );
drivers/scsi/bfa/bfa_hw_cb.c +1 -0
@@ -15,6 +15,7 @@* General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" #include "bfi_cbreg.h"
drivers/scsi/bfa/bfa_hw_ct.c +1 -0
@@ -15,6 +15,7 @@* General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_modules.h" #include "bfi_ctreg.h"
drivers/scsi/bfa/bfa_ioc.c +3 -3
@@ -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 )); }
drivers/scsi/bfa/bfa_ioc.h +4 -4
@@ -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 =cpu_to_be32 (pa >>32 ); }struct bfa_ioc_regs_s {
drivers/scsi/bfa/bfa_ioc_cb.c +1 -0
@@ -15,6 +15,7 @@* General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_ioc.h" #include "bfi_cbreg.h" #include "bfa_defs.h"
drivers/scsi/bfa/bfa_ioc_ct.c +1 -0
@@ -15,6 +15,7 @@* General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_ioc.h" #include "bfi_ctreg.h" #include "bfa_defs.h"
drivers/scsi/bfa/bfa_os_inc.h deleted +0 -143
143 lines not on this page · raw message
drivers/scsi/bfa/bfa_port.c +8 -7
@@ -15,6 +15,7 @@* General Public License for more details. */ +#include "bfad_drv.h" #include "bfa_defs_svc.h" #include "bfa_port.h" #include "bfi.h"
@@ -36,7 +37,7 @@ bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) i += 2) { t0 = dip[i]; t1 = dip[i +1 ]; -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN dip[i] =be32_to_cpu (t0); dip[i +1 ] =be32_to_cpu (t1);#else
@@ -96,13 +97,13 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) port->stats_busy =BFA_FALSE ;if (status ==BFA_STATUS_OK ) { -struct bfa_timeval_s tv; +struct timeval tv;memcpy (port->stats, port->stats_dma.kva,sizeof (union bfa_port_stats_u ));bfa_port_stats_swap (port, port->stats); -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time; }
@@ -124,7 +125,7 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)static void bfa_port_clear_stats_isr (struct bfa_port_s *port,bfa_status_t status) { -struct bfa_timeval_s tv; +struct timeval tv; port->stats_status = status; port->stats_busy =BFA_FALSE ;
@@ -132,7 +133,7 @@ bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status)/* * re-initialize time stamp for stats reset */ -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); port->stats_reset_time = tv.tv_sec;if (port->stats_cbfn) {
@@ -432,7 +433,7 @@ void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev, struct bfa_trc_mod_s *trcmod) { - struct bfa_timeval_s tv; + struct timeval tv;bfa_assert (port);
@@ -452,7 +453,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,/* * initialize time stamp for stats reset */ -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); port->stats_reset_time = tv.tv_sec;bfa_trc (port,0 );
drivers/scsi/bfa/bfa_svc.c +22 -15
@@ -15,11 +15,10 @@* General Public License for more details. */ -#include "bfa_os_inc.h" +#include "bfad_drv.h" #include "bfa_plog.h" #include "bfa_cs.h" #include "bfa_modules.h" -#include "bfad_drv.h" BFA_TRC_FILE (HAL ,FCXP );BFA_MODULE (fcxp);
@@ -286,6 +285,18 @@ plkd_validate_logrec(struct bfa_plog_rec_s *pl_rec)return 0 ; } +static u64 +bfa_get_log_time (void ) +{ +u64 system_time =0 ; +struct timeval tv; +do_gettimeofday (&tv); + +/* We are interested in seconds only. */ + system_time = tv.tv_sec; +return system_time; +} +static void bfa_plog_add (struct bfa_plog_s *plog,struct bfa_plog_rec_s *pl_rec) {
@@ -306,7 +317,7 @@ bfa_plog_add(struct bfa_plog_s *plog, struct bfa_plog_rec_s *pl_rec)memcpy (pl_recp, pl_rec,sizeof (struct bfa_plog_rec_s )); - pl_recp->tv =bfa_os_get_log_time (); + pl_recp->tv =bfa_get_log_time ();BFA_PL_LOG_REC_INCR (plog->tail);if (plog->head == plog->tail)
@@ -2728,7 +2739,7 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,struct bfa_fcport_s *fcport =BFA_FCPORT_MOD (bfa);struct bfa_port_cfg_s *port_cfg = &fcport->cfg;struct bfa_fcport_ln_s *ln = &fcport->ln; -struct bfa_timeval_s tv; +struct timeval tv;memset (fcport,0 ,sizeof (struct bfa_fcport_s )); fcport->bfa = bfa;
@@ -2742,7 +2753,7 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,/* * initialize time stamp for stats reset */ -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); fcport->stats_reset_time = tv.tv_sec;/*
@@ -2967,7 +2978,7 @@ bfa_fcport_fcoe_stats_swap(struct bfa_fcoe_stats_s *d,for (i =0 ; i < ((sizeof (struct bfa_fcoe_stats_s ))/sizeof (u32)); i = i +2 ) { -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIAN dip[i] =be32_to_cpu (sip[i]); dip[i +1 ] =be32_to_cpu (sip[i +1 ]);#else
@@ -2984,7 +2995,7 @@ __bfa_cb_fcport_stats_get(void *cbarg, bfa_boolean_t complete)if (complete) {if (fcport->stats_status ==BFA_STATUS_OK ) { -struct bfa_timeval_s tv; +struct timeval tv;/* Swap FC QoS or FCoE stats */ if (bfa_ioc_get_fcmode (&fcport->bfa->ioc)) {
@@ -2996,7 +3007,7 @@ __bfa_cb_fcport_stats_get(void *cbarg, bfa_boolean_t complete) &fcport->stats_ret->fcoe, &fcport->stats->fcoe); -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); fcport->stats_ret->fcoe.secs_reset = tv.tv_sec - fcport->stats_reset_time; }
@@ -3055,12 +3066,12 @@ __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete)struct bfa_fcport_s *fcport = cbarg;if (complete) { -struct bfa_timeval_s tv; +struct timeval tv;/* * re-initialize time stamp for stats reset */ -bfa_os_gettimeofday (&tv); +do_gettimeofday (&tv); fcport->stats_reset_time = tv.tv_sec; fcport->stats_cbfn (fcport->stats_cbarg, fcport->stats_status);
@@ -4929,11 +4940,7 @@ bfa_uf_start(struct bfa_s *bfa) {bfa_uf_post_all (BFA_UF_MOD (bfa)); } - -/* -* hal_uf_api -*/ - +/* * Register handler for all unsolicted recieve frames. *
drivers/scsi/bfa/bfad.c +4 -5
@@ -32,7 +32,6 @@#include "bfad_drv.h" #include "bfad_im.h" #include "bfa_fcs.h" -#include "bfa_os_inc.h" #include "bfa_defs.h" #include "bfa.h"
@@ -1102,15 +1101,15 @@ bfad_start_ops(struct bfad_s *bfad) {/* * If bfa_linkup_delay is set to -1 default; try to retrive the -* value using the bfad_os_get_linkup_delay(); else use the +* value using the bfad_get_linkup_delay(); else use the * passed in module param value as the bfa_linkup_delay. */ if (bfa_linkup_delay <0 ) { - bfa_linkup_delay =bfad_os_get_linkup_delay (bfad); -bfad_os_rport_online_wait (bfad); + bfa_linkup_delay =bfad_get_linkup_delay (bfad); +bfad_rport_online_wait (bfad); bfa_linkup_delay =-1 ; }else -bfad_os_rport_online_wait (bfad); +bfad_rport_online_wait (bfad);BFA_LOG (KERN_INFO , bfad, log_level,"bfa device claimed\n" );
drivers/scsi/bfa/bfad_attr.c +5 -5
@@ -40,7 +40,7 @@ bfad_im_get_starget_port_id(struct scsi_target *starget) bfad = im_port->bfad;spin_lock_irqsave (&bfad->bfad_lock, flags); - itnim =bfad_os_get_itnim (im_port, starget->id); + itnim =bfad_get_itnim (im_port, starget->id);if (itnim) fc_id =bfa_fcs_itnim_get_fcid (&itnim->fcs_itnim);
@@ -66,7 +66,7 @@ bfad_im_get_starget_node_name(struct scsi_target *starget) bfad = im_port->bfad;spin_lock_irqsave (&bfad->bfad_lock, flags); - itnim =bfad_os_get_itnim (im_port, starget->id); + itnim =bfad_get_itnim (im_port, starget->id);if (itnim) node_name =bfa_fcs_itnim_get_nwwn (&itnim->fcs_itnim);
@@ -92,7 +92,7 @@ bfad_im_get_starget_port_name(struct scsi_target *starget) bfad = im_port->bfad;spin_lock_irqsave (&bfad->bfad_lock, flags); - itnim =bfad_os_get_itnim (im_port, starget->id); + itnim =bfad_get_itnim (im_port, starget->id);if (itnim) port_name =bfa_fcs_itnim_get_pwwn (&itnim->fcs_itnim);
@@ -111,7 +111,7 @@ bfad_im_get_host_port_id(struct Scsi_Host *shost)struct bfad_port_s *port = im_port->port;fc_host_port_id (shost) = -bfa_os_hton3b (bfa_fcs_lport_get_fcid (port->fcs_port)); +bfa_hton3b (bfa_fcs_lport_get_fcid (port->fcs_port)); }/*
@@ -487,7 +487,7 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)wait_for_completion (vport->comp_del); free_scsi_host: -bfad_os_scsi_host_free (bfad, im_port); +bfad_scsi_host_free (bfad, im_port);kfree (vport);
drivers/scsi/bfa/bfad_drv.h +23 -14
@@ -26,7 +26,23 @@#ifndef __BFAD_DRV_H__#define __BFAD_DRV_H__ -#include "bfa_os_inc.h" +#include <linux/types.h> +#include <linux/version.h> +#include <linux/pci.h> +#include <linux/dma-mapping.h> +#include <linux/idr.h> +#include <linux/interrupt.h> +#include <linux/cdev.h> +#include <linux/fs.h> +#include <linux/delay.h> +#include <linux/vmalloc.h> +#include <linux/workqueue.h> +#include <linux/bitops.h> +#include <scsi/scsi.h> +#include <scsi/scsi_host.h> +#include <scsi/scsi_tcq.h> +#include <scsi/scsi_transport_fc.h> +#include <scsi/scsi_transport.h> #include "bfa_modules.h" #include "bfa_fcs.h"
@@ -272,19 +288,12 @@ do { \ } while (0) -#define list_remove_head (list, entry, type, member) \ -do { \ - entry = NULL; \ - if (!list_empty(list)) { \ - entry = list_entry((list)->next, type, member); \ - list_del_init(&entry->member); \ - } \ +#define BFA_LOG(level, bfad, mask, fmt, arg...) \ +do { \ + if (((mask) == 4) || (level[1] <= '4')) \ + dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \ } while (0) -#define list_get_first (list, type, member) \ -((list_empty(list)) ? NULL : \ - list_entry((list)->next, type, member)) -bfa_status_t bfad_vport_create (struct bfad_s *bfad,u16 vf_id,struct bfa_lport_cfg_s *port_cfg,struct device *dev);
@@ -316,8 +325,8 @@ void bfad_debugfs_exit(struct bfad_port_s *port);void bfad_pci_remove (struct pci_dev *pdev);int bfad_pci_probe (struct pci_dev *pdev,const struct pci_device_id *pid); -void bfad_os_rport_online_wait (struct bfad_s *bfad); -int bfad_os_get_linkup_delay (struct bfad_s *bfad); +void bfad_rport_online_wait (struct bfad_s *bfad); +int bfad_get_linkup_delay (struct bfad_s *bfad);int bfad_install_msix_handler (struct bfad_s *bfad);extern struct idr bfad_im_port_index;
drivers/scsi/bfa/bfad_im.c +19 -19
@@ -92,10 +92,10 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,if (!cmnd->result && itnim && (bfa_lun_queue_depth > cmnd->device->queue_depth)) {/* Queue depth adjustment for good status completion */ -bfad_os_ramp_up_qdepth (itnim, cmnd->device); +bfad_ramp_up_qdepth (itnim, cmnd->device); }else if (cmnd->result ==SAM_STAT_TASK_SET_FULL && itnim) {/* qfull handling */ -bfad_os_handle_qfull (itnim, cmnd->device); +bfad_handle_qfull (itnim, cmnd->device); } }
@@ -123,7 +123,7 @@ bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio)if (itnim_data) { itnim = itnim_data->itnim;if (itnim) -bfad_os_ramp_up_qdepth (itnim, cmnd->device); +bfad_ramp_up_qdepth (itnim, cmnd->device); } }
@@ -365,7 +365,7 @@ bfad_im_reset_bus_handler(struct scsi_cmnd *cmnd)spin_lock_irqsave (&bfad->bfad_lock, flags);for (i =0 ; i <MAX_FCP_TARGET ; i++) { - itnim =bfad_os_get_itnim (im_port, i); + itnim =bfad_get_itnim (im_port, i);if (itnim) { cmnd->SCp.ptr = (char *)&wq; rc =bfad_im_target_reset_send (bfad, cmnd, itnim);
@@ -546,7 +546,7 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port,mutex_unlock (&bfad_mutex); - im_port->shost =bfad_os_scsi_host_alloc (im_port, bfad); + im_port->shost =bfad_scsi_host_alloc (im_port, bfad);if (!im_port->shost) { error =1 ; goto out_free_idr;
@@ -572,7 +572,7 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port, }/* setup host fixed attribute if the lk supports */ -bfad_os_fc_host_init (im_port); +bfad_fc_host_init (im_port);return 0 ;
@@ -683,7 +683,7 @@ bfad_im_probe(struct bfad_s *bfad) bfad->im = im; im->bfad = bfad; -if (bfad_os_thread_workq (bfad) !=BFA_STATUS_OK ) { +if (bfad_thread_workq (bfad) !=BFA_STATUS_OK ) {kfree (im); rc =BFA_STATUS_FAILED ; }
@@ -696,14 +696,14 @@ void bfad_im_probe_undo(struct bfad_s *bfad) {if (bfad->im) { -bfad_os_destroy_workq (bfad->im); +bfad_destroy_workq (bfad->im);kfree (bfad->im); bfad->im =NULL ; } }struct Scsi_Host * -bfad_os_scsi_host_alloc (struct bfad_im_port_s *im_port,struct bfad_s *bfad) +bfad_scsi_host_alloc (struct bfad_im_port_s *im_port,struct bfad_s *bfad) {struct scsi_host_template *sht;
@@ -718,7 +718,7 @@ bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) }void -bfad_os_scsi_host_free (struct bfad_s *bfad,struct bfad_im_port_s *im_port) +bfad_scsi_host_free (struct bfad_s *bfad,struct bfad_im_port_s *im_port) {if (!(im_port->flags &BFAD_PORT_DELETE ))flush_workqueue (bfad->im->drv_workq);
@@ -728,7 +728,7 @@ bfad_os_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port) }void -bfad_os_destroy_workq (struct bfad_im_s *im) +bfad_destroy_workq (struct bfad_im_s *im) {if (im && im->drv_workq) {flush_workqueue (im->drv_workq);
@@ -738,7 +738,7 @@ bfad_os_destroy_workq(struct bfad_im_s *im) }bfa_status_t -bfad_os_thread_workq (struct bfad_s *bfad) +bfad_thread_workq (struct bfad_s *bfad) {struct bfad_im_s *im = bfad->im;
@@ -842,7 +842,7 @@ bfad_im_module_exit(void) }void -bfad_os_ramp_up_qdepth (struct bfad_itnim_s *itnim,struct scsi_device *sdev) +bfad_ramp_up_qdepth (struct bfad_itnim_s *itnim,struct scsi_device *sdev) {struct scsi_device *tmp_sdev;
@@ -870,7 +870,7 @@ bfad_os_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev) }void -bfad_os_handle_qfull (struct bfad_itnim_s *itnim,struct scsi_device *sdev) +bfad_handle_qfull (struct bfad_itnim_s *itnim,struct scsi_device *sdev) {struct scsi_device *tmp_sdev;
@@ -884,7 +884,7 @@ bfad_os_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev) }struct bfad_itnim_s * -bfad_os_get_itnim (struct bfad_im_port_s *im_port,int id) +bfad_get_itnim (struct bfad_im_port_s *im_port,int id) {struct bfad_itnim_s *itnim =NULL ;
@@ -945,7 +945,7 @@ bfad_im_supported_speeds(struct bfa_s *bfa) }void -bfad_os_fc_host_init (struct bfad_im_port_s *im_port) +bfad_fc_host_init (struct bfad_im_port_s *im_port) {struct Scsi_Host *host = im_port->shost;struct bfad_s *bfad = im_port->bfad;
@@ -989,7 +989,7 @@ bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim) rport_ids.port_name =cpu_to_be64 (bfa_fcs_itnim_get_pwwn (&itnim->fcs_itnim)); rport_ids.port_id = -bfa_os_hton3b (bfa_fcs_itnim_get_fcid (&itnim->fcs_itnim)); +bfa_hton3b (bfa_fcs_itnim_get_fcid (&itnim->fcs_itnim)); rport_ids.roles =FC_RPORT_ROLE_UNKNOWN ; itnim->fc_rport = fc_rport =
@@ -1191,7 +1191,7 @@ out_fail_cmd:static DEF_SCSI_QCMD (bfad_im_queuecommand) void -bfad_os_rport_online_wait (struct bfad_s *bfad) +bfad_rport_online_wait (struct bfad_s *bfad) {int i;int rport_delay =10 ;
@@ -1219,7 +1219,7 @@ bfad_os_rport_online_wait(struct bfad_s *bfad) }int -bfad_os_get_linkup_delay (struct bfad_s *bfad) +bfad_get_linkup_delay (struct bfad_s *bfad) {u8 nwwns =0 ;wwn_t wwns[BFA_PREBOOT_BOOTLUN_MAX ];
drivers/scsi/bfa/bfad_im.h +8 -8
@@ -117,17 +117,17 @@ struct bfad_im_s {char drv_workq_name[KOBJ_NAME_LEN ]; }; -struct Scsi_Host *bfad_os_scsi_host_alloc (struct bfad_im_port_s *im_port, +struct Scsi_Host *bfad_scsi_host_alloc (struct bfad_im_port_s *im_port,struct bfad_s *); -bfa_status_t bfad_os_thread_workq (struct bfad_s *bfad); -void bfad_os_destroy_workq (struct bfad_im_s *im); -void bfad_os_fc_host_init (struct bfad_im_port_s *im_port); -void bfad_os_scsi_host_free (struct bfad_s *bfad, +bfa_status_t bfad_thread_workq (struct bfad_s *bfad); +void bfad_destroy_workq (struct bfad_im_s *im); +void bfad_fc_host_init (struct bfad_im_port_s *im_port); +void bfad_scsi_host_free (struct bfad_s *bfad,struct bfad_im_port_s *im_port); -void bfad_os_ramp_up_qdepth (struct bfad_itnim_s *itnim, +void bfad_ramp_up_qdepth (struct bfad_itnim_s *itnim,struct scsi_device *sdev); -void bfad_os_handle_qfull (struct bfad_itnim_s *itnim,struct scsi_device *sdev); -struct bfad_itnim_s *bfad_os_get_itnim (struct bfad_im_port_s *im_port,int id); +void bfad_handle_qfull (struct bfad_itnim_s *itnim,struct scsi_device *sdev); +struct bfad_itnim_s *bfad_get_itnim (struct bfad_im_port_s *im_port,int id);extern struct scsi_host_template bfad_im_scsi_host_template;extern struct scsi_host_template bfad_im_vport_template;
drivers/scsi/bfa/bfi.h +1 -1
@@ -104,7 +104,7 @@ union bfi_addr_u {* Scatter Gather Element */ struct bfi_sge_s { -#ifdef __BIGENDIAN +#ifdef __BIG_ENDIANu32 flags:2 , rsvd:2 , sg_len:28 ;
Signature · 1 line
1.7.2.1