Skip to content

Commit f16a175

Browse files
Maggie ZhangJames Bottomley
authored andcommitted
[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>
1 parent f314878 commit f16a175

28 files changed

Lines changed: 210 additions & 304 deletions

‎drivers/scsi/bfa/bfa.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef __BFA_H__
1818
#define __BFA_H__
1919

20-
#include "bfa_os_inc.h"
20+
#include "bfad_drv.h"
2121
#include "bfa_cs.h"
2222
#include "bfa_plog.h"
2323
#include "bfa_defs_svc.h"

‎drivers/scsi/bfa/bfa_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* General Public License for more details.
1616
*/
1717

18+
#include "bfad_drv.h"
1819
#include "bfa_modules.h"
1920
#include "bfi_ctreg.h"
20-
#include "bfad_drv.h"
2121

2222
BFA_TRC_FILE(HAL, CORE);
2323

‎drivers/scsi/bfa/bfa_cs.h‎

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef __BFA_CS_H__
2323
#define __BFA_CS_H__
2424

25-
#include "bfa_os_inc.h"
25+
#include "bfad_drv.h"
2626

2727
/*
2828
* BFA TRC
@@ -32,12 +32,20 @@
3232
#define BFA_TRC_MAX (4 * 1024)
3333
#endif
3434

35+
#define BFA_TRC_TS(_trcm) \
36+
({ \
37+
struct timeval tv; \
38+
\
39+
do_gettimeofday(&tv); \
40+
(tv.tv_sec*1000000+tv.tv_usec); \
41+
})
42+
3543
#ifndef BFA_TRC_TS
3644
#define BFA_TRC_TS(_trcm) ((_trcm)->ticks++)
3745
#endif
3846

3947
struct bfa_trc_s {
40-
#ifdef __BIGENDIAN
48+
#ifdef __BIG_ENDIAN
4149
u16 fileno;
4250
u16 line;
4351
#else
@@ -361,4 +369,43 @@ bfa_wc_wait(struct bfa_wc_s *wc)
361369
bfa_wc_down(wc);
362370
}
363371

372+
static inline void
373+
wwn2str(char *wwn_str, u64 wwn)
374+
{
375+
union {
376+
u64 wwn;
377+
u8 byte[8];
378+
} w;
379+
380+
w.wwn = wwn;
381+
sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", w.byte[0],
382+
w.byte[1], w.byte[2], w.byte[3], w.byte[4], w.byte[5],
383+
w.byte[6], w.byte[7]);
384+
}
385+
386+
static inline void
387+
fcid2str(char *fcid_str, u32 fcid)
388+
{
389+
union {
390+
u32 fcid;
391+
u8 byte[4];
392+
} f;
393+
394+
f.fcid = fcid;
395+
sprintf(fcid_str, "%02x:%02x:%02x", f.byte[1], f.byte[2], f.byte[3]);
396+
}
397+
398+
#define bfa_swap_3b(_x) \
399+
((((_x) & 0xff) << 16) | \
400+
((_x) & 0x00ff00) | \
401+
(((_x) & 0xff0000) >> 16))
402+
403+
#ifndef __BIG_ENDIAN
404+
#define bfa_hton3b(_x) bfa_swap_3b(_x)
405+
#else
406+
#define bfa_hton3b(_x) (_x)
407+
#endif
408+
409+
#define bfa_ntoh3b(_x) bfa_hton3b(_x)
410+
364411
#endif /* __BFA_CS_H__ */

‎drivers/scsi/bfa/bfa_defs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define __BFA_DEFS_H__
2020

2121
#include "bfa_fc.h"
22-
#include "bfa_os_inc.h"
22+
#include "bfad_drv.h"
2323

2424
#define BFA_MFG_SERIALNUM_SIZE 11
2525
#define STRSZ(_n) (((_n) + 4) & ~3)

‎drivers/scsi/bfa/bfa_fc.h‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifndef __BFA_FC_H__
1919
#define __BFA_FC_H__
2020

21-
#include "bfa_os_inc.h"
21+
#include "bfad_drv.h"
2222

2323
typedef u64 wwn_t;
2424

@@ -62,7 +62,7 @@ struct scsi_cdb_s {
6262
* Fibre Channel Header Structure (FCHS) definition
6363
*/
6464
struct fchs_s {
65-
#ifdef __BIGENDIAN
65+
#ifdef __BIG_ENDIAN
6666
u32 routing:4; /* routing bits */
6767
u32 cat_info:4; /* category info */
6868
#else
@@ -317,7 +317,7 @@ struct fc_plogi_csp_s {
317317
u8 verlo; /* FC-PH low version */
318318
__be16 bbcred; /* BB_Credit */
319319

320-
#ifdef __BIGENDIAN
320+
#ifdef __BIG_ENDIAN
321321
u8 ciro:1, /* continuously increasing RO */
322322
rro:1, /* random relative offset */
323323
npiv_supp:1, /* NPIV supported */
@@ -367,7 +367,7 @@ struct fc_plogi_csp_s {
367367
* FC-PH-x. Figure 78. pg. 318.
368368
*/
369369
struct fc_plogi_clp_s {
370-
#ifdef __BIGENDIAN
370+
#ifdef __BIG_ENDIAN
371371
u32 class_valid:1;
372372
u32 intermix:1; /* class intermix supported if set =1.
373373
* valid only for class1. Reserved for
@@ -532,7 +532,7 @@ struct fc_rsi_s {
532532
*/
533533
struct fc_prli_params_s {
534534
u32 reserved:16;
535-
#ifdef __BIGENDIAN
535+
#ifdef __BIG_ENDIAN
536536
u32 reserved1:5;
537537
u32 rec_support:1;
538538
u32 task_retry_id:1;
@@ -574,7 +574,7 @@ enum {
574574
struct fc_prli_params_page_s {
575575
u32 type:8;
576576
u32 codext:8;
577-
#ifdef __BIGENDIAN
577+
#ifdef __BIG_ENDIAN
578578
u32 origprocasv:1;
579579
u32 rsppav:1;
580580
u32 imagepair:1;
@@ -610,7 +610,7 @@ struct fc_prli_s {
610610
struct fc_prlo_params_page_s {
611611
u32 type:8;
612612
u32 type_ext:8;
613-
#ifdef __BIGENDIAN
613+
#ifdef __BIG_ENDIAN
614614
u32 opa_valid:1; /* originator process associator
615615
* valid
616616
*/
@@ -646,7 +646,7 @@ struct fc_prlo_acc_params_page_s {
646646
u32 type:8;
647647
u32 type_ext:8;
648648

649-
#ifdef __BIGENDIAN
649+
#ifdef __BIG_ENDIAN
650650
u32 opa_valid:1; /* originator process associator
651651
* valid
652652
*/
@@ -803,7 +803,7 @@ struct fc_tprlo_params_page_s {
803803
u32 type:8;
804804
u32 type_ext:8;
805805

806-
#ifdef __BIGENDIAN
806+
#ifdef __BIG_ENDIAN
807807
u32 opa_valid:1;
808808
u32 rpa_valid:1;
809809
u32 tpo_nport_valid:1;
@@ -1177,7 +1177,7 @@ struct fc_srr_s {
11771177
struct fcp_cmnd_s {
11781178
struct scsi_lun lun; /* 64-bit LU number */
11791179
u8 crn; /* command reference number */
1180-
#ifdef __BIGENDIAN
1180+
#ifdef __BIG_ENDIAN
11811181
u8 resvd:1,
11821182
priority:4, /* FCP-3: SAM-3 priority */
11831183
taskattr:3; /* scsi task attribute */
@@ -1187,7 +1187,7 @@ struct fcp_cmnd_s {
11871187
resvd:1;
11881188
#endif
11891189
u8 tm_flags; /* task management flags */
1190-
#ifdef __BIGENDIAN
1190+
#ifdef __BIG_ENDIAN
11911191
u8 addl_cdb_len:6, /* additional CDB length words */
11921192
iodir:2; /* read/write FCP_DATA IUs */
11931193
#else
@@ -1273,7 +1273,7 @@ struct fcp_rspinfo_s {
12731273
struct fcp_resp_s {
12741274
u32 reserved[2]; /* 2 words reserved */
12751275
u16 reserved2;
1276-
#ifdef __BIGENDIAN
1276+
#ifdef __BIG_ENDIAN
12771277
u8 reserved3:3;
12781278
u8 fcp_conf_req:1; /* FCP_CONF is requested */
12791279
u8 resid_flags:2; /* underflow/overflow */

0 commit comments

Comments
 (0)