Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Maggie Zhang and committed by
James Bottomley
f16a1750 f314878a

+210 -304
+1 -1
drivers/scsi/bfa/bfa.h
··· 17 17 #ifndef __BFA_H__ 18 18 #define __BFA_H__ 19 19 20 - #include "bfa_os_inc.h" 20 + #include "bfad_drv.h" 21 21 #include "bfa_cs.h" 22 22 #include "bfa_plog.h" 23 23 #include "bfa_defs_svc.h"
+1 -1
drivers/scsi/bfa/bfa_core.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_modules.h" 19 20 #include "bfi_ctreg.h" 20 - #include "bfad_drv.h" 21 21 22 22 BFA_TRC_FILE(HAL, CORE); 23 23
+49 -2
drivers/scsi/bfa/bfa_cs.h
··· 22 22 #ifndef __BFA_CS_H__ 23 23 #define __BFA_CS_H__ 24 24 25 - #include "bfa_os_inc.h" 25 + #include "bfad_drv.h" 26 26 27 27 /* 28 28 * BFA TRC ··· 32 32 #define BFA_TRC_MAX (4 * 1024) 33 33 #endif 34 34 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 + 35 43 #ifndef BFA_TRC_TS 36 44 #define BFA_TRC_TS(_trcm) ((_trcm)->ticks++) 37 45 #endif 38 46 39 47 struct bfa_trc_s { 40 - #ifdef __BIGENDIAN 48 + #ifdef __BIG_ENDIAN 41 49 u16 fileno; 42 50 u16 line; 43 51 #else ··· 368 360 { 369 361 bfa_wc_down(wc); 370 362 } 363 + 364 + static inline void 365 + wwn2str(char *wwn_str, u64 wwn) 366 + { 367 + union { 368 + u64 wwn; 369 + u8 byte[8]; 370 + } w; 371 + 372 + w.wwn = wwn; 373 + sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", w.byte[0], 374 + w.byte[1], w.byte[2], w.byte[3], w.byte[4], w.byte[5], 375 + w.byte[6], w.byte[7]); 376 + } 377 + 378 + static inline void 379 + fcid2str(char *fcid_str, u32 fcid) 380 + { 381 + union { 382 + u32 fcid; 383 + u8 byte[4]; 384 + } f; 385 + 386 + f.fcid = fcid; 387 + sprintf(fcid_str, "%02x:%02x:%02x", f.byte[1], f.byte[2], f.byte[3]); 388 + } 389 + 390 + #define bfa_swap_3b(_x) \ 391 + ((((_x) & 0xff) << 16) | \ 392 + ((_x) & 0x00ff00) | \ 393 + (((_x) & 0xff0000) >> 16)) 394 + 395 + #ifndef __BIG_ENDIAN 396 + #define bfa_hton3b(_x) bfa_swap_3b(_x) 397 + #else 398 + #define bfa_hton3b(_x) (_x) 399 + #endif 400 + 401 + #define bfa_ntoh3b(_x) bfa_hton3b(_x) 371 402 372 403 #endif /* __BFA_CS_H__ */
+1 -1
drivers/scsi/bfa/bfa_defs.h
··· 19 19 #define __BFA_DEFS_H__ 20 20 21 21 #include "bfa_fc.h" 22 - #include "bfa_os_inc.h" 22 + #include "bfad_drv.h" 23 23 24 24 #define BFA_MFG_SERIALNUM_SIZE 11 25 25 #define STRSZ(_n) (((_n) + 4) & ~3)
+12 -12
drivers/scsi/bfa/bfa_fc.h
··· 18 18 #ifndef __BFA_FC_H__ 19 19 #define __BFA_FC_H__ 20 20 21 - #include "bfa_os_inc.h" 21 + #include "bfad_drv.h" 22 22 23 23 typedef u64 wwn_t; 24 24 ··· 62 62 * Fibre Channel Header Structure (FCHS) definition 63 63 */ 64 64 struct fchs_s { 65 - #ifdef __BIGENDIAN 65 + #ifdef __BIG_ENDIAN 66 66 u32 routing:4; /* routing bits */ 67 67 u32 cat_info:4; /* category info */ 68 68 #else ··· 317 317 u8 verlo; /* FC-PH low version */ 318 318 __be16 bbcred; /* BB_Credit */ 319 319 320 - #ifdef __BIGENDIAN 320 + #ifdef __BIG_ENDIAN 321 321 u8 ciro:1, /* continuously increasing RO */ 322 322 rro:1, /* random relative offset */ 323 323 npiv_supp:1, /* NPIV supported */ ··· 367 367 * FC-PH-x. Figure 78. pg. 318. 368 368 */ 369 369 struct fc_plogi_clp_s { 370 - #ifdef __BIGENDIAN 370 + #ifdef __BIG_ENDIAN 371 371 u32 class_valid:1; 372 372 u32 intermix:1; /* class intermix supported if set =1. 373 373 * valid only for class1. Reserved for ··· 532 532 */ 533 533 struct fc_prli_params_s { 534 534 u32 reserved:16; 535 - #ifdef __BIGENDIAN 535 + #ifdef __BIG_ENDIAN 536 536 u32 reserved1:5; 537 537 u32 rec_support:1; 538 538 u32 task_retry_id:1; ··· 574 574 struct fc_prli_params_page_s { 575 575 u32 type:8; 576 576 u32 codext:8; 577 - #ifdef __BIGENDIAN 577 + #ifdef __BIG_ENDIAN 578 578 u32 origprocasv:1; 579 579 u32 rsppav:1; 580 580 u32 imagepair:1; ··· 610 610 struct fc_prlo_params_page_s { 611 611 u32 type:8; 612 612 u32 type_ext:8; 613 - #ifdef __BIGENDIAN 613 + #ifdef __BIG_ENDIAN 614 614 u32 opa_valid:1; /* originator process associator 615 615 * valid 616 616 */ ··· 646 646 u32 type:8; 647 647 u32 type_ext:8; 648 648 649 - #ifdef __BIGENDIAN 649 + #ifdef __BIG_ENDIAN 650 650 u32 opa_valid:1; /* originator process associator 651 651 * valid 652 652 */ ··· 803 803 u32 type:8; 804 804 u32 type_ext:8; 805 805 806 - #ifdef __BIGENDIAN 806 + #ifdef __BIG_ENDIAN 807 807 u32 opa_valid:1; 808 808 u32 rpa_valid:1; 809 809 u32 tpo_nport_valid:1; ··· 1177 1177 struct fcp_cmnd_s { 1178 1178 struct scsi_lun lun; /* 64-bit LU number */ 1179 1179 u8 crn; /* command reference number */ 1180 - #ifdef __BIGENDIAN 1180 + #ifdef __BIG_ENDIAN 1181 1181 u8 resvd:1, 1182 1182 priority:4, /* FCP-3: SAM-3 priority */ 1183 1183 taskattr:3; /* scsi task attribute */ ··· 1187 1187 resvd:1; 1188 1188 #endif 1189 1189 u8 tm_flags; /* task management flags */ 1190 - #ifdef __BIGENDIAN 1190 + #ifdef __BIG_ENDIAN 1191 1191 u8 addl_cdb_len:6, /* additional CDB length words */ 1192 1192 iodir:2; /* read/write FCP_DATA IUs */ 1193 1193 #else ··· 1273 1273 struct fcp_resp_s { 1274 1274 u32 reserved[2]; /* 2 words reserved */ 1275 1275 u16 reserved2; 1276 - #ifdef __BIGENDIAN 1276 + #ifdef __BIG_ENDIAN 1277 1277 u8 reserved3:3; 1278 1278 u8 fcp_conf_req:1; /* FCP_CONF is requested */ 1279 1279 u8 resid_flags:2; /* underflow/overflow */
+29 -29
drivers/scsi/bfa/bfa_fcbuild.c
··· 18 18 * fcbuild.c - FC link service frame building and parsing routines 19 19 */ 20 20 21 - #include "bfa_os_inc.h" 21 + #include "bfad_drv.h" 22 22 #include "bfa_fcbuild.h" 23 23 24 24 /* ··· 48 48 fc_els_req_tmpl.cat_info = FC_CAT_LD_REQUEST; 49 49 fc_els_req_tmpl.type = FC_TYPE_ELS; 50 50 fc_els_req_tmpl.f_ctl = 51 - bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 51 + bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 52 52 FCTL_SI_XFER); 53 53 fc_els_req_tmpl.rx_id = FC_RXID_ANY; 54 54 ··· 59 59 fc_els_rsp_tmpl.cat_info = FC_CAT_LD_REPLY; 60 60 fc_els_rsp_tmpl.type = FC_TYPE_ELS; 61 61 fc_els_rsp_tmpl.f_ctl = 62 - bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 62 + bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 63 63 FCTL_END_SEQ | FCTL_SI_XFER); 64 64 fc_els_rsp_tmpl.rx_id = FC_RXID_ANY; 65 65 ··· 68 68 */ 69 69 fc_bls_req_tmpl.routing = FC_RTG_BASIC_LINK; 70 70 fc_bls_req_tmpl.type = FC_TYPE_BLS; 71 - fc_bls_req_tmpl.f_ctl = bfa_os_hton3b(FCTL_END_SEQ | FCTL_SI_XFER); 71 + fc_bls_req_tmpl.f_ctl = bfa_hton3b(FCTL_END_SEQ | FCTL_SI_XFER); 72 72 fc_bls_req_tmpl.rx_id = FC_RXID_ANY; 73 73 74 74 /* ··· 78 78 fc_bls_rsp_tmpl.cat_info = FC_CAT_BA_ACC; 79 79 fc_bls_rsp_tmpl.type = FC_TYPE_BLS; 80 80 fc_bls_rsp_tmpl.f_ctl = 81 - bfa_os_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 81 + bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH | 82 82 FCTL_END_SEQ | FCTL_SI_XFER); 83 83 fc_bls_rsp_tmpl.rx_id = FC_RXID_ANY; 84 84 ··· 129 129 fcp_fchs_tmpl.cat_info = FC_CAT_UNSOLICIT_CMD; 130 130 fcp_fchs_tmpl.type = FC_TYPE_FCP; 131 131 fcp_fchs_tmpl.f_ctl = 132 - bfa_os_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); 132 + bfa_hton3b(FCTL_FS_EXCH | FCTL_END_SEQ | FCTL_SI_XFER); 133 133 fcp_fchs_tmpl.seq_id = 1; 134 134 fcp_fchs_tmpl.rx_id = FC_RXID_ANY; 135 135 } ··· 143 143 fchs->cat_info = FC_CAT_UNSOLICIT_CTRL; 144 144 fchs->type = FC_TYPE_SERVICES; 145 145 fchs->f_ctl = 146 - bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 146 + bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 147 147 FCTL_SI_XFER); 148 148 fchs->rx_id = FC_RXID_ANY; 149 149 fchs->d_id = (d_id); ··· 232 232 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size, 233 233 u8 set_npiv, u8 set_auth, u16 local_bb_credits) 234 234 { 235 - u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 235 + u32 d_id = bfa_hton3b(FC_FABRIC_PORT); 236 236 __be32 *vvl_info; 237 237 238 238 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); ··· 289 289 fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 290 290 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size) 291 291 { 292 - u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 292 + u32 d_id = bfa_hton3b(FC_FABRIC_PORT); 293 293 294 294 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 295 295 ··· 770 770 fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id, 771 771 u32 s_id, u32 *pid_list, u16 npids) 772 772 { 773 - u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_os_hton3b(d_id)); 773 + u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_hton3b(d_id)); 774 774 int i = 0; 775 775 776 - fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0); 776 + fc_els_req_build(fchs, bfa_hton3b(dctlr_id), s_id, 0); 777 777 778 778 memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s)); 779 779 ··· 1045 1045 { 1046 1046 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1047 1047 struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1); 1048 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1048 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1049 1049 1050 1050 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1051 1051 fc_gs_cthdr_build(cthdr, s_id, GS_GID_PN); ··· 1061 1061 { 1062 1062 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1063 1063 fcgs_gpnid_req_t *gpnid = (fcgs_gpnid_req_t *) (cthdr + 1); 1064 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1064 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1065 1065 1066 1066 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1067 1067 fc_gs_cthdr_build(cthdr, s_id, GS_GPN_ID); ··· 1077 1077 { 1078 1078 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1079 1079 fcgs_gnnid_req_t *gnnid = (fcgs_gnnid_req_t *) (cthdr + 1); 1080 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1080 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1081 1081 1082 1082 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1083 1083 fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID); ··· 1104 1104 fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, 1105 1105 u8 set_br_reg, u32 s_id, u16 ox_id) 1106 1106 { 1107 - u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1107 + u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER); 1108 1108 1109 1109 fc_els_req_build(fchs, d_id, s_id, ox_id); 1110 1110 ··· 1121 1121 fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, 1122 1122 u32 s_id, u16 ox_id) 1123 1123 { 1124 - u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1124 + u32 d_id = bfa_hton3b(FC_FABRIC_CONTROLLER); 1125 1125 u16 payldlen; 1126 1126 1127 1127 fc_els_req_build(fchs, d_id, s_id, ox_id); ··· 1143 1143 { 1144 1144 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1145 1145 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); 1146 - u32 type_value, d_id = bfa_os_hton3b(FC_NAME_SERVER); 1146 + u32 type_value, d_id = bfa_hton3b(FC_NAME_SERVER); 1147 1147 u8 index; 1148 1148 1149 1149 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); ··· 1167 1167 { 1168 1168 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1169 1169 struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1); 1170 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1170 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1171 1171 1172 1172 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1173 1173 fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID); ··· 1187 1187 { 1188 1188 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1189 1189 struct fcgs_rffid_req_s *rffid = (struct fcgs_rffid_req_s *)(cthdr + 1); 1190 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1190 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1191 1191 1192 1192 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1193 1193 fc_gs_cthdr_build(cthdr, s_id, GS_RFF_ID); ··· 1209 1209 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1210 1210 struct fcgs_rspnid_req_s *rspnid = 1211 1211 (struct fcgs_rspnid_req_s *)(cthdr + 1); 1212 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1212 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1213 1213 1214 1214 fc_gs_fchdr_build(fchs, d_id, s_id, ox_id); 1215 1215 fc_gs_cthdr_build(cthdr, s_id, GS_RSPN_ID); ··· 1229 1229 1230 1230 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1231 1231 struct fcgs_gidft_req_s *gidft = (struct fcgs_gidft_req_s *)(cthdr + 1); 1232 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1232 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1233 1233 1234 1234 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1235 1235 ··· 1249 1249 { 1250 1250 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1251 1251 struct fcgs_rpnid_req_s *rpnid = (struct fcgs_rpnid_req_s *)(cthdr + 1); 1252 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1252 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1253 1253 1254 1254 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1255 1255 fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID); ··· 1267 1267 { 1268 1268 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1269 1269 struct fcgs_rnnid_req_s *rnnid = (struct fcgs_rnnid_req_s *)(cthdr + 1); 1270 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1270 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1271 1271 1272 1272 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1273 1273 fc_gs_cthdr_build(cthdr, s_id, GS_RNN_ID); ··· 1286 1286 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1287 1287 struct fcgs_rcsid_req_s *rcsid = 1288 1288 (struct fcgs_rcsid_req_s *) (cthdr + 1); 1289 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1289 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1290 1290 1291 1291 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1292 1292 fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID); ··· 1304 1304 { 1305 1305 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1306 1306 struct fcgs_rptid_req_s *rptid = (struct fcgs_rptid_req_s *)(cthdr + 1); 1307 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1307 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1308 1308 1309 1309 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1310 1310 fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID); ··· 1321 1321 { 1322 1322 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1323 1323 struct fcgs_ganxt_req_s *ganxt = (struct fcgs_ganxt_req_s *)(cthdr + 1); 1324 - u32 d_id = bfa_os_hton3b(FC_NAME_SERVER); 1324 + u32 d_id = bfa_hton3b(FC_NAME_SERVER); 1325 1325 1326 1326 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1327 1327 fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT); ··· 1341 1341 { 1342 1342 1343 1343 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1344 - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1344 + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); 1345 1345 1346 1346 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1347 1347 fc_gs_fdmi_cthdr_build(cthdr, s_id, cmd_code); ··· 1377 1377 { 1378 1378 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1379 1379 fcgs_gmal_req_t *gmal = (fcgs_gmal_req_t *) (cthdr + 1); 1380 - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1380 + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); 1381 1381 1382 1382 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1383 1383 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GMAL_CMD, ··· 1397 1397 { 1398 1398 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1399 1399 fcgs_gfn_req_t *gfn = (fcgs_gfn_req_t *) (cthdr + 1); 1400 - u32 d_id = bfa_os_hton3b(FC_MGMT_SERVER); 1400 + u32 d_id = bfa_hton3b(FC_MGMT_SERVER); 1401 1401 1402 1402 fc_gs_fchdr_build(fchs, d_id, s_id, 0); 1403 1403 fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GFN_CMD,
+1 -1
drivers/scsi/bfa/bfa_fcbuild.h
··· 21 21 #ifndef __FCBUILD_H__ 22 22 #define __FCBUILD_H__ 23 23 24 - #include "bfa_os_inc.h" 24 + #include "bfad_drv.h" 25 25 #include "bfa_fc.h" 26 26 #include "bfa_defs_fcs.h" 27 27
+3 -21
drivers/scsi/bfa/bfa_fcpim.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_modules.h" 19 - #include "bfa_os_inc.h" 20 20 21 21 BFA_TRC_FILE(HAL, FCPIM); 22 22 BFA_MODULE(fcpim); ··· 1560 1560 bfa_sm_cmp_state(itnim, bfa_itnim_sm_iocdisable)); 1561 1561 } 1562 1562 1563 - bfa_status_t 1564 - bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim, 1565 - struct bfa_itnim_ioprofile_s *ioprofile) 1566 - { 1567 - struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(itnim->bfa); 1568 - if (!fcpim->io_profile) 1569 - return BFA_STATUS_IOPROFILE_OFF; 1570 - 1571 - itnim->ioprofile.index = BFA_IOBUCKET_MAX; 1572 - itnim->ioprofile.io_profile_start_time = 1573 - bfa_io_profile_start_time(itnim->bfa); 1574 - itnim->ioprofile.clock_res_mul = bfa_io_lat_clock_res_mul; 1575 - itnim->ioprofile.clock_res_div = bfa_io_lat_clock_res_div; 1576 - *ioprofile = itnim->ioprofile; 1577 - 1578 - return BFA_STATUS_OK; 1579 - } 1580 - 1581 1563 void 1582 1564 bfa_itnim_clear_stats(struct bfa_itnim_s *itnim) 1583 1565 { ··· 2334 2352 scsi_for_each_sg(cmnd, sg, ioim->nsges, i) { 2335 2353 if (i == 0) { 2336 2354 /* build inline IO SG element */ 2337 - addr = bfa_os_sgaddr(sg_dma_address(sg)); 2355 + addr = bfa_sgaddr_le(sg_dma_address(sg)); 2338 2356 sge->sga = *(union bfi_addr_u *) &addr; 2339 2357 pgdlen = sg_dma_len(sg); 2340 2358 sge->sg_len = pgdlen; ··· 2346 2364 if (sge_id == 0) 2347 2365 sgpge = sgpg->sgpg->sges; 2348 2366 2349 - addr = bfa_os_sgaddr(sg_dma_address(sg)); 2367 + addr = bfa_sgaddr_le(sg_dma_address(sg)); 2350 2368 sgpge->sga = *(union bfi_addr_u *) &addr; 2351 2369 sgpge->sg_len = sg_dma_len(sg); 2352 2370 pgcumsz += sgpge->sg_len;
+4 -4
drivers/scsi/bfa/bfa_fcs.c
··· 19 19 * bfa_fcs.c BFA FCS main 20 20 */ 21 21 22 + #include "bfad_drv.h" 22 23 #include "bfa_fcs.h" 23 24 #include "bfa_fcbuild.h" 24 - #include "bfad_drv.h" 25 25 26 26 BFA_TRC_FILE(FCS, FCS); 27 27 ··· 1097 1097 * external loopback cable is in place. Our own FLOGI frames are 1098 1098 * sometimes looped back when switch port gets temporarily bypassed. 1099 1099 */ 1100 - if ((pid == bfa_os_ntoh3b(FC_FABRIC_PORT)) && 1100 + if ((pid == bfa_ntoh3b(FC_FABRIC_PORT)) && 1101 1101 (els_cmd->els_code == FC_ELS_FLOGI) && 1102 1102 (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) { 1103 1103 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOOPBACK); ··· 1107 1107 /* 1108 1108 * FLOGI/EVFP exchanges should be consumed by base fabric. 1109 1109 */ 1110 - if (fchs->d_id == bfa_os_hton3b(FC_FABRIC_PORT)) { 1110 + if (fchs->d_id == bfa_hton3b(FC_FABRIC_PORT)) { 1111 1111 bfa_trc(fabric->fcs, pid); 1112 1112 bfa_fcs_fabric_process_uf(fabric, fchs, len); 1113 1113 return; ··· 1220 1220 return; 1221 1221 1222 1222 reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 1223 - bfa_os_hton3b(FC_FABRIC_PORT), 1223 + bfa_hton3b(FC_FABRIC_PORT), 1224 1224 n2n_port->reply_oxid, pcfg->pwwn, 1225 1225 pcfg->nwwn, 1226 1226 bfa_fcport_get_maxfrsize(bfa),
+1 -1
drivers/scsi/bfa/bfa_fcs.h
··· 61 61 #define N2N_LOCAL_PID 0x010000 62 62 #define N2N_REMOTE_PID 0x020000 63 63 #define BFA_FCS_RETRY_TIMEOUT 2000 64 - #define BFA_FCS_PID_IS_WKA(pid) ((bfa_os_ntoh3b(pid) > 0xFFF000) ? 1 : 0) 64 + #define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0) 65 65 66 66 67 67
+1 -1
drivers/scsi/bfa/bfa_fcs_fcpim.c
··· 19 19 * fcpim.c - FCP initiator mode i-t nexus state machine 20 20 */ 21 21 22 + #include "bfad_drv.h" 22 23 #include "bfa_fcs.h" 23 24 #include "bfa_fcbuild.h" 24 - #include "bfad_drv.h" 25 25 #include "bfad_im.h" 26 26 27 27 BFA_TRC_FILE(FCS, FCPIM);
+6 -6
drivers/scsi/bfa/bfa_fcs_lport.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_fcs.h" 19 20 #include "bfa_fcbuild.h" 20 21 #include "bfa_fc.h" 21 - #include "bfad_drv.h" 22 22 23 23 BFA_TRC_FILE(FCS, PORT); 24 24 ··· 2818 2818 ms->fcxp = fcxp; 2819 2819 2820 2820 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 2821 - bfa_os_hton3b(FC_MGMT_SERVER), 2821 + bfa_hton3b(FC_MGMT_SERVER), 2822 2822 bfa_fcs_lport_get_fcid(port), 0, 2823 2823 port->port_cfg.pwwn, port->port_cfg.nwwn, 2824 2824 bfa_fcport_get_maxfrsize(port->fcs->bfa)); ··· 3575 3575 ns->fcxp = fcxp; 3576 3576 3577 3577 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 3578 - bfa_os_hton3b(FC_NAME_SERVER), 3578 + bfa_hton3b(FC_NAME_SERVER), 3579 3579 bfa_fcs_lport_get_fcid(port), 0, 3580 3580 port->port_cfg.pwwn, port->port_cfg.nwwn, 3581 3581 bfa_fcport_get_maxfrsize(port->fcs->bfa)); ··· 4654 4654 4655 4655 while ((qe != qh) && (i < nrports)) { 4656 4656 rport = (struct bfa_fcs_rport_s *) qe; 4657 - if (bfa_os_ntoh3b(rport->pid) > 0xFFF000) { 4657 + if (bfa_ntoh3b(rport->pid) > 0xFFF000) { 4658 4658 qe = bfa_q_next(qe); 4659 4659 bfa_trc(fcs, (u32) rport->pwwn); 4660 4660 bfa_trc(fcs, rport->pid); ··· 4702 4702 4703 4703 while ((qe != qh) && (i < *nrports)) { 4704 4704 rport = (struct bfa_fcs_rport_s *) qe; 4705 - if (bfa_os_ntoh3b(rport->pid) > 0xFFF000) { 4705 + if (bfa_ntoh3b(rport->pid) > 0xFFF000) { 4706 4706 qe = bfa_q_next(qe); 4707 4707 bfa_trc(fcs, (u32) rport->pwwn); 4708 4708 bfa_trc(fcs, rport->pid); ··· 4753 4753 4754 4754 while (qe != qh) { 4755 4755 rport = (struct bfa_fcs_rport_s *) qe; 4756 - if ((bfa_os_ntoh3b(rport->pid) > 0xFFF000) || 4756 + if ((bfa_ntoh3b(rport->pid) > 0xFFF000) || 4757 4757 (bfa_fcs_rport_get_state(rport) == 4758 4758 BFA_RPORT_OFFLINE)) { 4759 4759 qe = bfa_q_next(qe);
+1 -1
drivers/scsi/bfa/bfa_fcs_rport.c
··· 19 19 * rport.c Remote port implementation. 20 20 */ 21 21 22 + #include "bfad_drv.h" 22 23 #include "bfa_fcs.h" 23 24 #include "bfa_fcbuild.h" 24 - #include "bfad_drv.h" 25 25 26 26 BFA_TRC_FILE(FCS, RPORT); 27 27
+1
drivers/scsi/bfa/bfa_hw_cb.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_modules.h" 19 20 #include "bfi_cbreg.h" 20 21
+1
drivers/scsi/bfa/bfa_hw_ct.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_modules.h" 19 20 #include "bfi_ctreg.h" 20 21
+3 -3
drivers/scsi/bfa/bfa_ioc.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_ioc.h" 19 20 #include "bfi_ctreg.h" 20 21 #include "bfa_defs.h" 21 22 #include "bfa_defs_svc.h" 22 - #include "bfad_drv.h" 23 23 24 24 BFA_TRC_FILE(CNA, IOC); 25 25 ··· 1428 1428 bfa_ioc_send_enable(struct bfa_ioc_s *ioc) 1429 1429 { 1430 1430 struct bfi_ioc_ctrl_req_s enable_req; 1431 - struct bfa_timeval_s tv; 1431 + struct timeval tv; 1432 1432 1433 1433 bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ, 1434 1434 bfa_ioc_portid(ioc)); 1435 1435 enable_req.ioc_class = ioc->ioc_mc; 1436 - bfa_os_gettimeofday(&tv); 1436 + do_gettimeofday(&tv); 1437 1437 enable_req.tv_sec = be32_to_cpu(tv.tv_sec); 1438 1438 bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s)); 1439 1439 }
+4 -4
drivers/scsi/bfa/bfa_ioc.h
··· 18 18 #ifndef __BFA_IOC_H__ 19 19 #define __BFA_IOC_H__ 20 20 21 - #include "bfa_os_inc.h" 21 + #include "bfad_drv.h" 22 22 #include "bfa_cs.h" 23 23 #include "bfi.h" 24 24 ··· 74 74 #define bfa_swap_words(_x) ( \ 75 75 ((_x) << 32) | ((_x) >> 32)) 76 76 77 - #ifdef __BIGENDIAN 77 + #ifdef __BIG_ENDIAN 78 78 #define bfa_sge_to_be(_x) 79 79 #define bfa_sge_to_le(_x) bfa_sge_word_swap(_x) 80 80 #define bfa_sgaddr_le(_x) bfa_swap_words(_x) ··· 120 120 __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa) 121 121 { 122 122 dma_addr->a32.addr_lo = (__be32) pa; 123 - dma_addr->a32.addr_hi = (__be32) (bfa_os_u32(pa)); 123 + dma_addr->a32.addr_hi = (__be32) (pa >> 32); 124 124 } 125 125 126 126 ··· 130 130 __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) 131 131 { 132 132 dma_addr->a32.addr_lo = cpu_to_be32(pa); 133 - dma_addr->a32.addr_hi = cpu_to_be32(bfa_os_u32(pa)); 133 + dma_addr->a32.addr_hi = cpu_to_be32(pa >> 32); 134 134 } 135 135 136 136 struct bfa_ioc_regs_s {
+1
drivers/scsi/bfa/bfa_ioc_cb.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_ioc.h" 19 20 #include "bfi_cbreg.h" 20 21 #include "bfa_defs.h"
+1
drivers/scsi/bfa/bfa_ioc_ct.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_ioc.h" 19 20 #include "bfi_ctreg.h" 20 21 #include "bfa_defs.h"
-143
drivers/scsi/bfa/bfa_os_inc.h
··· 1 - /* 2 - * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. 3 - * All rights reserved 4 - * www.brocade.com 5 - * 6 - * Linux driver for Brocade Fibre Channel Host Bus Adapter. 7 - * 8 - * This program is free software; you can redistribute it and/or modify it 9 - * under the terms of the GNU General Public License (GPL) Version 2 as 10 - * published by the Free Software Foundation 11 - * 12 - * This program is distributed in the hope that it will be useful, but 13 - * WITHOUT ANY WARRANTY; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 - * General Public License for more details. 16 - */ 17 - 18 - #ifndef __BFA_OS_INC_H__ 19 - #define __BFA_OS_INC_H__ 20 - 21 - #include <linux/types.h> 22 - #include <linux/version.h> 23 - #include <linux/pci.h> 24 - #include <linux/dma-mapping.h> 25 - #include <linux/idr.h> 26 - #include <linux/interrupt.h> 27 - #include <linux/cdev.h> 28 - #include <linux/fs.h> 29 - #include <linux/delay.h> 30 - #include <linux/vmalloc.h> 31 - #include <linux/workqueue.h> 32 - #include <linux/bitops.h> 33 - #include <scsi/scsi.h> 34 - #include <scsi/scsi_host.h> 35 - #include <scsi/scsi_tcq.h> 36 - #include <scsi/scsi_transport_fc.h> 37 - #include <scsi/scsi_transport.h> 38 - 39 - #ifdef __BIG_ENDIAN 40 - #define __BIGENDIAN 41 - #endif 42 - 43 - static inline u64 bfa_os_get_log_time(void) 44 - { 45 - u64 system_time = 0; 46 - struct timeval tv; 47 - do_gettimeofday(&tv); 48 - 49 - /* We are interested in seconds only. */ 50 - system_time = tv.tv_sec; 51 - return system_time; 52 - } 53 - 54 - #define bfa_io_lat_clock_res_div HZ 55 - #define bfa_io_lat_clock_res_mul 1000 56 - 57 - #define BFA_LOG(level, bfad, mask, fmt, arg...) \ 58 - do { \ 59 - if (((mask) == 4) || (level[1] <= '4')) \ 60 - dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \ 61 - } while (0) 62 - 63 - #define bfa_swap_3b(_x) \ 64 - ((((_x) & 0xff) << 16) | \ 65 - ((_x) & 0x00ff00) | \ 66 - (((_x) & 0xff0000) >> 16)) 67 - 68 - #define bfa_os_swap_sgaddr(_x) ((u64)( \ 69 - (((u64)(_x) & (u64)0x00000000000000ffull) << 32) | \ 70 - (((u64)(_x) & (u64)0x000000000000ff00ull) << 32) | \ 71 - (((u64)(_x) & (u64)0x0000000000ff0000ull) << 32) | \ 72 - (((u64)(_x) & (u64)0x00000000ff000000ull) << 32) | \ 73 - (((u64)(_x) & (u64)0x000000ff00000000ull) >> 32) | \ 74 - (((u64)(_x) & (u64)0x0000ff0000000000ull) >> 32) | \ 75 - (((u64)(_x) & (u64)0x00ff000000000000ull) >> 32) | \ 76 - (((u64)(_x) & (u64)0xff00000000000000ull) >> 32))) 77 - 78 - #ifndef __BIGENDIAN 79 - #define bfa_os_hton3b(_x) bfa_swap_3b(_x) 80 - #define bfa_os_sgaddr(_x) (_x) 81 - #else 82 - #define bfa_os_hton3b(_x) (_x) 83 - #define bfa_os_sgaddr(_x) bfa_os_swap_sgaddr(_x) 84 - #endif 85 - 86 - #define bfa_os_ntoh3b(_x) bfa_os_hton3b(_x) 87 - #define bfa_os_u32(__pa64) ((__pa64) >> 32) 88 - 89 - #define BFA_TRC_TS(_trcm) \ 90 - ({ \ 91 - struct timeval tv; \ 92 - \ 93 - do_gettimeofday(&tv); \ 94 - (tv.tv_sec*1000000+tv.tv_usec); \ 95 - }) 96 - 97 - #define boolean_t int 98 - 99 - /* 100 - * For current time stamp, OS API will fill-in 101 - */ 102 - struct bfa_timeval_s { 103 - u32 tv_sec; /* seconds */ 104 - u32 tv_usec; /* microseconds */ 105 - }; 106 - 107 - static inline void 108 - bfa_os_gettimeofday(struct bfa_timeval_s *tv) 109 - { 110 - struct timeval tmp_tv; 111 - 112 - do_gettimeofday(&tmp_tv); 113 - tv->tv_sec = (u32) tmp_tv.tv_sec; 114 - tv->tv_usec = (u32) tmp_tv.tv_usec; 115 - } 116 - 117 - static inline void 118 - wwn2str(char *wwn_str, u64 wwn) 119 - { 120 - union { 121 - u64 wwn; 122 - u8 byte[8]; 123 - } w; 124 - 125 - w.wwn = wwn; 126 - sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", w.byte[0], 127 - w.byte[1], w.byte[2], w.byte[3], w.byte[4], w.byte[5], 128 - w.byte[6], w.byte[7]); 129 - } 130 - 131 - static inline void 132 - fcid2str(char *fcid_str, u32 fcid) 133 - { 134 - union { 135 - u32 fcid; 136 - u8 byte[4]; 137 - } f; 138 - 139 - f.fcid = fcid; 140 - sprintf(fcid_str, "%02x:%02x:%02x", f.byte[1], f.byte[2], f.byte[3]); 141 - } 142 - 143 - #endif /* __BFA_OS_INC_H__ */
+8 -7
drivers/scsi/bfa/bfa_port.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 + #include "bfad_drv.h" 18 19 #include "bfa_defs_svc.h" 19 20 #include "bfa_port.h" 20 21 #include "bfi.h" ··· 37 36 i += 2) { 38 37 t0 = dip[i]; 39 38 t1 = dip[i + 1]; 40 - #ifdef __BIGENDIAN 39 + #ifdef __BIG_ENDIAN 41 40 dip[i] = be32_to_cpu(t0); 42 41 dip[i + 1] = be32_to_cpu(t1); 43 42 #else ··· 97 96 port->stats_busy = BFA_FALSE; 98 97 99 98 if (status == BFA_STATUS_OK) { 100 - struct bfa_timeval_s tv; 99 + struct timeval tv; 101 100 102 101 memcpy(port->stats, port->stats_dma.kva, 103 102 sizeof(union bfa_port_stats_u)); 104 103 bfa_port_stats_swap(port, port->stats); 105 104 106 - bfa_os_gettimeofday(&tv); 105 + do_gettimeofday(&tv); 107 106 port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time; 108 107 } 109 108 ··· 125 124 static void 126 125 bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) 127 126 { 128 - struct bfa_timeval_s tv; 127 + struct timeval tv; 129 128 130 129 port->stats_status = status; 131 130 port->stats_busy = BFA_FALSE; ··· 133 132 /* 134 133 * re-initialize time stamp for stats reset 135 134 */ 136 - bfa_os_gettimeofday(&tv); 135 + do_gettimeofday(&tv); 137 136 port->stats_reset_time = tv.tv_sec; 138 137 139 138 if (port->stats_cbfn) { ··· 433 432 bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, 434 433 void *dev, struct bfa_trc_mod_s *trcmod) 435 434 { 436 - struct bfa_timeval_s tv; 435 + struct timeval tv; 437 436 438 437 bfa_assert(port); 439 438 ··· 453 452 /* 454 453 * initialize time stamp for stats reset 455 454 */ 456 - bfa_os_gettimeofday(&tv); 455 + do_gettimeofday(&tv); 457 456 port->stats_reset_time = tv.tv_sec; 458 457 459 458 bfa_trc(port, 0);
+21 -14
drivers/scsi/bfa/bfa_svc.c
··· 15 15 * General Public License for more details. 16 16 */ 17 17 18 - #include "bfa_os_inc.h" 18 + #include "bfad_drv.h" 19 19 #include "bfa_plog.h" 20 20 #include "bfa_cs.h" 21 21 #include "bfa_modules.h" 22 - #include "bfad_drv.h" 23 22 24 23 BFA_TRC_FILE(HAL, FCXP); 25 24 BFA_MODULE(fcxp); ··· 285 286 return 0; 286 287 } 287 288 289 + static u64 290 + bfa_get_log_time(void) 291 + { 292 + u64 system_time = 0; 293 + struct timeval tv; 294 + do_gettimeofday(&tv); 295 + 296 + /* We are interested in seconds only. */ 297 + system_time = tv.tv_sec; 298 + return system_time; 299 + } 300 + 288 301 static void 289 302 bfa_plog_add(struct bfa_plog_s *plog, struct bfa_plog_rec_s *pl_rec) 290 303 { ··· 317 306 318 307 memcpy(pl_recp, pl_rec, sizeof(struct bfa_plog_rec_s)); 319 308 320 - pl_recp->tv = bfa_os_get_log_time(); 309 + pl_recp->tv = bfa_get_log_time(); 321 310 BFA_PL_LOG_REC_INCR(plog->tail); 322 311 323 312 if (plog->head == plog->tail) ··· 2739 2728 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2740 2729 struct bfa_port_cfg_s *port_cfg = &fcport->cfg; 2741 2730 struct bfa_fcport_ln_s *ln = &fcport->ln; 2742 - struct bfa_timeval_s tv; 2731 + struct timeval tv; 2743 2732 2744 2733 memset(fcport, 0, sizeof(struct bfa_fcport_s)); 2745 2734 fcport->bfa = bfa; ··· 2753 2742 /* 2754 2743 * initialize time stamp for stats reset 2755 2744 */ 2756 - bfa_os_gettimeofday(&tv); 2745 + do_gettimeofday(&tv); 2757 2746 fcport->stats_reset_time = tv.tv_sec; 2758 2747 2759 2748 /* ··· 2978 2967 2979 2968 for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32)); 2980 2969 i = i + 2) { 2981 - #ifdef __BIGENDIAN 2970 + #ifdef __BIG_ENDIAN 2982 2971 dip[i] = be32_to_cpu(sip[i]); 2983 2972 dip[i + 1] = be32_to_cpu(sip[i + 1]); 2984 2973 #else ··· 2995 2984 2996 2985 if (complete) { 2997 2986 if (fcport->stats_status == BFA_STATUS_OK) { 2998 - struct bfa_timeval_s tv; 2987 + struct timeval tv; 2999 2988 3000 2989 /* Swap FC QoS or FCoE stats */ 3001 2990 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { ··· 3007 2996 &fcport->stats_ret->fcoe, 3008 2997 &fcport->stats->fcoe); 3009 2998 3010 - bfa_os_gettimeofday(&tv); 2999 + do_gettimeofday(&tv); 3011 3000 fcport->stats_ret->fcoe.secs_reset = 3012 3001 tv.tv_sec - fcport->stats_reset_time; 3013 3002 } ··· 3066 3055 struct bfa_fcport_s *fcport = cbarg; 3067 3056 3068 3057 if (complete) { 3069 - struct bfa_timeval_s tv; 3058 + struct timeval tv; 3070 3059 3071 3060 /* 3072 3061 * re-initialize time stamp for stats reset 3073 3062 */ 3074 - bfa_os_gettimeofday(&tv); 3063 + do_gettimeofday(&tv); 3075 3064 fcport->stats_reset_time = tv.tv_sec; 3076 3065 3077 3066 fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); ··· 4940 4929 { 4941 4930 bfa_uf_post_all(BFA_UF_MOD(bfa)); 4942 4931 } 4943 - 4944 - /* 4945 - * hal_uf_api 4946 - */ 4947 4932 4948 4933 /* 4949 4934 * Register handler for all unsolicted recieve frames.
+4 -5
drivers/scsi/bfa/bfad.c
··· 32 32 #include "bfad_drv.h" 33 33 #include "bfad_im.h" 34 34 #include "bfa_fcs.h" 35 - #include "bfa_os_inc.h" 36 35 #include "bfa_defs.h" 37 36 #include "bfa.h" 38 37 ··· 1101 1102 1102 1103 /* 1103 1104 * If bfa_linkup_delay is set to -1 default; try to retrive the 1104 - * value using the bfad_os_get_linkup_delay(); else use the 1105 + * value using the bfad_get_linkup_delay(); else use the 1105 1106 * passed in module param value as the bfa_linkup_delay. 1106 1107 */ 1107 1108 if (bfa_linkup_delay < 0) { 1108 - bfa_linkup_delay = bfad_os_get_linkup_delay(bfad); 1109 - bfad_os_rport_online_wait(bfad); 1109 + bfa_linkup_delay = bfad_get_linkup_delay(bfad); 1110 + bfad_rport_online_wait(bfad); 1110 1111 bfa_linkup_delay = -1; 1111 1112 } else 1112 - bfad_os_rport_online_wait(bfad); 1113 + bfad_rport_online_wait(bfad); 1113 1114 1114 1115 BFA_LOG(KERN_INFO, bfad, bfa_log_level, "bfa device claimed\n"); 1115 1116
+5 -5
drivers/scsi/bfa/bfad_attr.c
··· 40 40 bfad = im_port->bfad; 41 41 spin_lock_irqsave(&bfad->bfad_lock, flags); 42 42 43 - itnim = bfad_os_get_itnim(im_port, starget->id); 43 + itnim = bfad_get_itnim(im_port, starget->id); 44 44 if (itnim) 45 45 fc_id = bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim); 46 46 ··· 66 66 bfad = im_port->bfad; 67 67 spin_lock_irqsave(&bfad->bfad_lock, flags); 68 68 69 - itnim = bfad_os_get_itnim(im_port, starget->id); 69 + itnim = bfad_get_itnim(im_port, starget->id); 70 70 if (itnim) 71 71 node_name = bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim); 72 72 ··· 92 92 bfad = im_port->bfad; 93 93 spin_lock_irqsave(&bfad->bfad_lock, flags); 94 94 95 - itnim = bfad_os_get_itnim(im_port, starget->id); 95 + itnim = bfad_get_itnim(im_port, starget->id); 96 96 if (itnim) 97 97 port_name = bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim); 98 98 ··· 111 111 struct bfad_port_s *port = im_port->port; 112 112 113 113 fc_host_port_id(shost) = 114 - bfa_os_hton3b(bfa_fcs_lport_get_fcid(port->fcs_port)); 114 + bfa_hton3b(bfa_fcs_lport_get_fcid(port->fcs_port)); 115 115 } 116 116 117 117 /* ··· 487 487 wait_for_completion(vport->comp_del); 488 488 489 489 free_scsi_host: 490 - bfad_os_scsi_host_free(bfad, im_port); 490 + bfad_scsi_host_free(bfad, im_port); 491 491 492 492 kfree(vport); 493 493
+23 -14
drivers/scsi/bfa/bfad_drv.h
··· 26 26 #ifndef __BFAD_DRV_H__ 27 27 #define __BFAD_DRV_H__ 28 28 29 - #include "bfa_os_inc.h" 29 + #include <linux/types.h> 30 + #include <linux/version.h> 31 + #include <linux/pci.h> 32 + #include <linux/dma-mapping.h> 33 + #include <linux/idr.h> 34 + #include <linux/interrupt.h> 35 + #include <linux/cdev.h> 36 + #include <linux/fs.h> 37 + #include <linux/delay.h> 38 + #include <linux/vmalloc.h> 39 + #include <linux/workqueue.h> 40 + #include <linux/bitops.h> 41 + #include <scsi/scsi.h> 42 + #include <scsi/scsi_host.h> 43 + #include <scsi/scsi_tcq.h> 44 + #include <scsi/scsi_transport_fc.h> 45 + #include <scsi/scsi_transport.h> 30 46 31 47 #include "bfa_modules.h" 32 48 #include "bfa_fcs.h" ··· 288 272 } while (0) 289 273 290 274 291 - #define list_remove_head(list, entry, type, member) \ 292 - do { \ 293 - entry = NULL; \ 294 - if (!list_empty(list)) { \ 295 - entry = list_entry((list)->next, type, member); \ 296 - list_del_init(&entry->member); \ 297 - } \ 275 + #define BFA_LOG(level, bfad, mask, fmt, arg...) \ 276 + do { \ 277 + if (((mask) == 4) || (level[1] <= '4')) \ 278 + dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \ 298 279 } while (0) 299 - 300 - #define list_get_first(list, type, member) \ 301 - ((list_empty(list)) ? NULL : \ 302 - list_entry((list)->next, type, member)) 303 280 304 281 bfa_status_t bfad_vport_create(struct bfad_s *bfad, u16 vf_id, 305 282 struct bfa_lport_cfg_s *port_cfg, ··· 325 316 326 317 void bfad_pci_remove(struct pci_dev *pdev); 327 318 int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid); 328 - void bfad_os_rport_online_wait(struct bfad_s *bfad); 329 - int bfad_os_get_linkup_delay(struct bfad_s *bfad); 319 + void bfad_rport_online_wait(struct bfad_s *bfad); 320 + int bfad_get_linkup_delay(struct bfad_s *bfad); 330 321 int bfad_install_msix_handler(struct bfad_s *bfad); 331 322 332 323 extern struct idr bfad_im_port_index;
+19 -19
drivers/scsi/bfa/bfad_im.c
··· 92 92 if (!cmnd->result && itnim && 93 93 (bfa_lun_queue_depth > cmnd->device->queue_depth)) { 94 94 /* Queue depth adjustment for good status completion */ 95 - bfad_os_ramp_up_qdepth(itnim, cmnd->device); 95 + bfad_ramp_up_qdepth(itnim, cmnd->device); 96 96 } else if (cmnd->result == SAM_STAT_TASK_SET_FULL && itnim) { 97 97 /* qfull handling */ 98 - bfad_os_handle_qfull(itnim, cmnd->device); 98 + bfad_handle_qfull(itnim, cmnd->device); 99 99 } 100 100 } 101 101 ··· 123 123 if (itnim_data) { 124 124 itnim = itnim_data->itnim; 125 125 if (itnim) 126 - bfad_os_ramp_up_qdepth(itnim, cmnd->device); 126 + bfad_ramp_up_qdepth(itnim, cmnd->device); 127 127 } 128 128 } 129 129 ··· 366 366 367 367 spin_lock_irqsave(&bfad->bfad_lock, flags); 368 368 for (i = 0; i < MAX_FCP_TARGET; i++) { 369 - itnim = bfad_os_get_itnim(im_port, i); 369 + itnim = bfad_get_itnim(im_port, i); 370 370 if (itnim) { 371 371 cmnd->SCp.ptr = (char *)&wq; 372 372 rc = bfad_im_target_reset_send(bfad, cmnd, itnim); ··· 547 547 548 548 mutex_unlock(&bfad_mutex); 549 549 550 - im_port->shost = bfad_os_scsi_host_alloc(im_port, bfad); 550 + im_port->shost = bfad_scsi_host_alloc(im_port, bfad); 551 551 if (!im_port->shost) { 552 552 error = 1; 553 553 goto out_free_idr; ··· 573 573 } 574 574 575 575 /* setup host fixed attribute if the lk supports */ 576 - bfad_os_fc_host_init(im_port); 576 + bfad_fc_host_init(im_port); 577 577 578 578 return 0; 579 579 ··· 684 684 bfad->im = im; 685 685 im->bfad = bfad; 686 686 687 - if (bfad_os_thread_workq(bfad) != BFA_STATUS_OK) { 687 + if (bfad_thread_workq(bfad) != BFA_STATUS_OK) { 688 688 kfree(im); 689 689 rc = BFA_STATUS_FAILED; 690 690 } ··· 697 697 bfad_im_probe_undo(struct bfad_s *bfad) 698 698 { 699 699 if (bfad->im) { 700 - bfad_os_destroy_workq(bfad->im); 700 + bfad_destroy_workq(bfad->im); 701 701 kfree(bfad->im); 702 702 bfad->im = NULL; 703 703 } 704 704 } 705 705 706 706 struct Scsi_Host * 707 - bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) 707 + bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) 708 708 { 709 709 struct scsi_host_template *sht; 710 710 ··· 719 719 } 720 720 721 721 void 722 - bfad_os_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port) 722 + bfad_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port) 723 723 { 724 724 if (!(im_port->flags & BFAD_PORT_DELETE)) 725 725 flush_workqueue(bfad->im->drv_workq); ··· 729 729 } 730 730 731 731 void 732 - bfad_os_destroy_workq(struct bfad_im_s *im) 732 + bfad_destroy_workq(struct bfad_im_s *im) 733 733 { 734 734 if (im && im->drv_workq) { 735 735 flush_workqueue(im->drv_workq); ··· 739 739 } 740 740 741 741 bfa_status_t 742 - bfad_os_thread_workq(struct bfad_s *bfad) 742 + bfad_thread_workq(struct bfad_s *bfad) 743 743 { 744 744 struct bfad_im_s *im = bfad->im; 745 745 ··· 843 843 } 844 844 845 845 void 846 - bfad_os_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev) 846 + bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev) 847 847 { 848 848 struct scsi_device *tmp_sdev; 849 849 ··· 871 871 } 872 872 873 873 void 874 - bfad_os_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev) 874 + bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev) 875 875 { 876 876 struct scsi_device *tmp_sdev; 877 877 ··· 885 885 } 886 886 887 887 struct bfad_itnim_s * 888 - bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id) 888 + bfad_get_itnim(struct bfad_im_port_s *im_port, int id) 889 889 { 890 890 struct bfad_itnim_s *itnim = NULL; 891 891 ··· 946 946 } 947 947 948 948 void 949 - bfad_os_fc_host_init(struct bfad_im_port_s *im_port) 949 + bfad_fc_host_init(struct bfad_im_port_s *im_port) 950 950 { 951 951 struct Scsi_Host *host = im_port->shost; 952 952 struct bfad_s *bfad = im_port->bfad; ··· 990 990 rport_ids.port_name = 991 991 cpu_to_be64(bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim)); 992 992 rport_ids.port_id = 993 - bfa_os_hton3b(bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim)); 993 + bfa_hton3b(bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim)); 994 994 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; 995 995 996 996 itnim->fc_rport = fc_rport = ··· 1192 1192 static DEF_SCSI_QCMD(bfad_im_queuecommand) 1193 1193 1194 1194 void 1195 - bfad_os_rport_online_wait(struct bfad_s *bfad) 1195 + bfad_rport_online_wait(struct bfad_s *bfad) 1196 1196 { 1197 1197 int i; 1198 1198 int rport_delay = 10; ··· 1220 1220 } 1221 1221 1222 1222 int 1223 - bfad_os_get_linkup_delay(struct bfad_s *bfad) 1223 + bfad_get_linkup_delay(struct bfad_s *bfad) 1224 1224 { 1225 1225 u8 nwwns = 0; 1226 1226 wwn_t wwns[BFA_PREBOOT_BOOTLUN_MAX];
+8 -8
drivers/scsi/bfa/bfad_im.h
··· 117 117 char drv_workq_name[KOBJ_NAME_LEN]; 118 118 }; 119 119 120 - struct Scsi_Host *bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, 120 + struct Scsi_Host *bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, 121 121 struct bfad_s *); 122 - bfa_status_t bfad_os_thread_workq(struct bfad_s *bfad); 123 - void bfad_os_destroy_workq(struct bfad_im_s *im); 124 - void bfad_os_fc_host_init(struct bfad_im_port_s *im_port); 125 - void bfad_os_scsi_host_free(struct bfad_s *bfad, 122 + bfa_status_t bfad_thread_workq(struct bfad_s *bfad); 123 + void bfad_destroy_workq(struct bfad_im_s *im); 124 + void bfad_fc_host_init(struct bfad_im_port_s *im_port); 125 + void bfad_scsi_host_free(struct bfad_s *bfad, 126 126 struct bfad_im_port_s *im_port); 127 - void bfad_os_ramp_up_qdepth(struct bfad_itnim_s *itnim, 127 + void bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, 128 128 struct scsi_device *sdev); 129 - void bfad_os_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev); 130 - struct bfad_itnim_s *bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id); 129 + void bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev); 130 + struct bfad_itnim_s *bfad_get_itnim(struct bfad_im_port_s *im_port, int id); 131 131 132 132 extern struct scsi_host_template bfad_im_scsi_host_template; 133 133 extern struct scsi_host_template bfad_im_vport_template;
+1 -1
drivers/scsi/bfa/bfi.h
··· 104 104 * Scatter Gather Element 105 105 */ 106 106 struct bfi_sge_s { 107 - #ifdef __BIGENDIAN 107 + #ifdef __BIG_ENDIAN 108 108 u32 flags:2, 109 109 rsvd:2, 110 110 sg_len:28;