Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f16a1750 authored by Maggie Zhang's avatar Maggie Zhang Committed by James Bottomley
Browse files

[SCSI] bfa: remove all OS wrappers



Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.

Signed-off-by: default avatarMaggie Zhang <xmzhang@brocade.com>
Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent f314878a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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"
+1 −1
Original line number Diff line number Diff line
@@ -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);

+49 −2
Original line number Diff line number Diff line
@@ -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__ */
+1 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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 */
Loading