mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
[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>
This commit is contained in:
committed by
James Bottomley
parent
f314878ab9
commit
f16a17507b
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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)
|
||||
|
||||
+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_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 */
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "bfad_drv.h"
|
||||
#include "bfa_modules.h"
|
||||
#include "bfi_cbreg.h"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "bfad_drv.h"
|
||||
#include "bfa_modules.h"
|
||||
#include "bfi_ctreg.h"
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
|
||||
* All rights reserved
|
||||
* www.brocade.com
|
||||
*
|
||||
* Linux driver for Brocade Fibre Channel Host Bus Adapter.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License (GPL) Version 2 as
|
||||
* published by the Free Software Foundation
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __BFA_OS_INC_H__
|
||||
#define __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>
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define __BIGENDIAN
|
||||
#endif
|
||||
|
||||
static inline u64 bfa_os_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;
|
||||
}
|
||||
|
||||
#define bfa_io_lat_clock_res_div HZ
|
||||
#define bfa_io_lat_clock_res_mul 1000
|
||||
|
||||
#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 bfa_swap_3b(_x) \
|
||||
((((_x) & 0xff) << 16) | \
|
||||
((_x) & 0x00ff00) | \
|
||||
(((_x) & 0xff0000) >> 16))
|
||||
|
||||
#define bfa_os_swap_sgaddr(_x) ((u64)( \
|
||||
(((u64)(_x) & (u64)0x00000000000000ffull) << 32) | \
|
||||
(((u64)(_x) & (u64)0x000000000000ff00ull) << 32) | \
|
||||
(((u64)(_x) & (u64)0x0000000000ff0000ull) << 32) | \
|
||||
(((u64)(_x) & (u64)0x00000000ff000000ull) << 32) | \
|
||||
(((u64)(_x) & (u64)0x000000ff00000000ull) >> 32) | \
|
||||
(((u64)(_x) & (u64)0x0000ff0000000000ull) >> 32) | \
|
||||
(((u64)(_x) & (u64)0x00ff000000000000ull) >> 32) | \
|
||||
(((u64)(_x) & (u64)0xff00000000000000ull) >> 32)))
|
||||
|
||||
#ifndef __BIGENDIAN
|
||||
#define bfa_os_hton3b(_x) bfa_swap_3b(_x)
|
||||
#define bfa_os_sgaddr(_x) (_x)
|
||||
#else
|
||||
#define bfa_os_hton3b(_x) (_x)
|
||||
#define bfa_os_sgaddr(_x) bfa_os_swap_sgaddr(_x)
|
||||
#endif
|
||||
|
||||
#define bfa_os_ntoh3b(_x) bfa_os_hton3b(_x)
|
||||
#define bfa_os_u32(__pa64) ((__pa64) >> 32)
|
||||
|
||||
#define BFA_TRC_TS(_trcm) \
|
||||
({ \
|
||||
struct timeval tv; \
|
||||
\
|
||||
do_gettimeofday(&tv); \
|
||||
(tv.tv_sec*1000000+tv.tv_usec); \
|
||||
})
|
||||
|
||||
#define boolean_t int
|
||||
|
||||
/*
|
||||
* For current time stamp, OS API will fill-in
|
||||
*/
|
||||
struct bfa_timeval_s {
|
||||
u32 tv_sec; /* seconds */
|
||||
u32 tv_usec; /* microseconds */
|
||||
};
|
||||
|
||||
static inline void
|
||||
bfa_os_gettimeofday(struct bfa_timeval_s *tv)
|
||||
{
|
||||
struct timeval tmp_tv;
|
||||
|
||||
do_gettimeofday(&tmp_tv);
|
||||
tv->tv_sec = (u32) tmp_tv.tv_sec;
|
||||
tv->tv_usec = (u32) tmp_tv.tv_usec;
|
||||
}
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
#endif /* __BFA_OS_INC_H__ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user