Commit ba816ea8 authored by Jing Huang's avatar Jing Huang Committed by James Bottomley

[SCSI] bfa: replace endian swap macros with the ones provided by linux

Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 6a18b167
...@@ -37,7 +37,7 @@ bfad_int_to_lun(u32 luno) ...@@ -37,7 +37,7 @@ bfad_int_to_lun(u32 luno)
} lun; } lun;
lun.bfa_lun = 0; lun.bfa_lun = 0;
lun.scsi_lun[0] = bfa_os_htons(luno); lun.scsi_lun[0] = cpu_to_be16(luno);
return lun.bfa_lun; return lun.bfa_lun;
} }
......
...@@ -400,14 +400,14 @@ bfa_iocfc_send_cfg(void *bfa_arg) ...@@ -400,14 +400,14 @@ bfa_iocfc_send_cfg(void *bfa_arg)
bfa_dma_be_addr_set(cfg_info->req_shadow_ci[i], bfa_dma_be_addr_set(cfg_info->req_shadow_ci[i],
iocfc->req_cq_shadow_ci[i].pa); iocfc->req_cq_shadow_ci[i].pa);
cfg_info->req_cq_elems[i] = cfg_info->req_cq_elems[i] =
bfa_os_htons(cfg->drvcfg.num_reqq_elems); cpu_to_be16(cfg->drvcfg.num_reqq_elems);
bfa_dma_be_addr_set(cfg_info->rsp_cq_ba[i], bfa_dma_be_addr_set(cfg_info->rsp_cq_ba[i],
iocfc->rsp_cq_ba[i].pa); iocfc->rsp_cq_ba[i].pa);
bfa_dma_be_addr_set(cfg_info->rsp_shadow_pi[i], bfa_dma_be_addr_set(cfg_info->rsp_shadow_pi[i],
iocfc->rsp_cq_shadow_pi[i].pa); iocfc->rsp_cq_shadow_pi[i].pa);
cfg_info->rsp_cq_elems[i] = cfg_info->rsp_cq_elems[i] =
bfa_os_htons(cfg->drvcfg.num_rspq_elems); cpu_to_be16(cfg->drvcfg.num_rspq_elems);
} }
/** /**
...@@ -634,11 +634,11 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) ...@@ -634,11 +634,11 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg;
fwcfg->num_cqs = fwcfg->num_cqs; fwcfg->num_cqs = fwcfg->num_cqs;
fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs); fwcfg->num_ioim_reqs = be16_to_cpu(fwcfg->num_ioim_reqs);
fwcfg->num_tskim_reqs = bfa_os_ntohs(fwcfg->num_tskim_reqs); fwcfg->num_tskim_reqs = be16_to_cpu(fwcfg->num_tskim_reqs);
fwcfg->num_fcxp_reqs = bfa_os_ntohs(fwcfg->num_fcxp_reqs); fwcfg->num_fcxp_reqs = be16_to_cpu(fwcfg->num_fcxp_reqs);
fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs); fwcfg->num_uf_bufs = be16_to_cpu(fwcfg->num_uf_bufs);
fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports); fwcfg->num_rports = be16_to_cpu(fwcfg->num_rports);
iocfc->cfgdone = BFA_TRUE; iocfc->cfgdone = BFA_TRUE;
...@@ -876,12 +876,12 @@ bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr) ...@@ -876,12 +876,12 @@ bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr)
attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce; attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce;
attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ? attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.delay) : be16_to_cpu(iocfc->cfginfo->intr_attr.delay) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.delay); be16_to_cpu(iocfc->cfgrsp->intr_attr.delay);
attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ? attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.latency) : be16_to_cpu(iocfc->cfginfo->intr_attr.latency) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.latency); be16_to_cpu(iocfc->cfgrsp->intr_attr.latency);
attr->config = iocfc->cfg; attr->config = iocfc->cfg;
} }
...@@ -893,8 +893,8 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) ...@@ -893,8 +893,8 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
struct bfi_iocfc_set_intr_req_s *m; struct bfi_iocfc_set_intr_req_s *m;
iocfc->cfginfo->intr_attr.coalesce = attr->coalesce; iocfc->cfginfo->intr_attr.coalesce = attr->coalesce;
iocfc->cfginfo->intr_attr.delay = bfa_os_htons(attr->delay); iocfc->cfginfo->intr_attr.delay = cpu_to_be16(attr->delay);
iocfc->cfginfo->intr_attr.latency = bfa_os_htons(attr->latency); iocfc->cfginfo->intr_attr.latency = cpu_to_be16(attr->latency);
if (!bfa_iocfc_is_operational(bfa)) if (!bfa_iocfc_is_operational(bfa))
return BFA_STATUS_OK; return BFA_STATUS_OK;
......
This diff is collapsed.
...@@ -2260,11 +2260,11 @@ __bfa_cb_ioim_comp(void *cbarg, bfa_boolean_t complete) ...@@ -2260,11 +2260,11 @@ __bfa_cb_ioim_comp(void *cbarg, bfa_boolean_t complete)
* setup residue value correctly for normal completions * setup residue value correctly for normal completions
*/ */
if (m->resid_flags == FCP_RESID_UNDER) { if (m->resid_flags == FCP_RESID_UNDER) {
residue = bfa_os_ntohl(m->residue); residue = be32_to_cpu(m->residue);
bfa_stats(ioim->itnim, iocomp_underrun); bfa_stats(ioim->itnim, iocomp_underrun);
} }
if (m->resid_flags == FCP_RESID_OVER) { if (m->resid_flags == FCP_RESID_OVER) {
residue = bfa_os_ntohl(m->residue); residue = be32_to_cpu(m->residue);
residue = -residue; residue = -residue;
bfa_stats(ioim->itnim, iocomp_overrun); bfa_stats(ioim->itnim, iocomp_overrun);
} }
...@@ -2357,7 +2357,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) ...@@ -2357,7 +2357,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
/** /**
* build i/o request message next * build i/o request message next
*/ */
m->io_tag = bfa_os_htons(ioim->iotag); m->io_tag = cpu_to_be16(ioim->iotag);
m->rport_hdl = ioim->itnim->rport->fw_handle; m->rport_hdl = ioim->itnim->rport->fw_handle;
m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio); m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio);
...@@ -2395,7 +2395,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) ...@@ -2395,7 +2395,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio); m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio);
m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio); m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio);
fcp_dl = bfa_cb_ioim_get_size(ioim->dio); fcp_dl = bfa_cb_ioim_get_size(ioim->dio);
m->cmnd.fcp_dl = bfa_os_htonl(fcp_dl); m->cmnd.fcp_dl = cpu_to_be32(fcp_dl);
/** /**
* set up I/O message header * set up I/O message header
...@@ -2436,7 +2436,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) ...@@ -2436,7 +2436,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
bfa_cb_ioim_get_cdb(ioim->dio) + 1, bfa_cb_ioim_get_cdb(ioim->dio) + 1,
m->cmnd.addl_cdb_len * sizeof(u32)); m->cmnd.addl_cdb_len * sizeof(u32));
fcp_cmnd_fcpdl(&m->cmnd) = fcp_cmnd_fcpdl(&m->cmnd) =
bfa_os_htonl(bfa_cb_ioim_get_size(ioim->dio)); cpu_to_be32(bfa_cb_ioim_get_size(ioim->dio));
} }
#endif #endif
...@@ -2564,7 +2564,7 @@ bfa_ioim_send_abort(struct bfa_ioim_s *ioim) ...@@ -2564,7 +2564,7 @@ bfa_ioim_send_abort(struct bfa_ioim_s *ioim)
msgop = BFI_IOIM_H2I_IOCLEANUP_REQ; msgop = BFI_IOIM_H2I_IOCLEANUP_REQ;
bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_lpuid(ioim->bfa));
m->io_tag = bfa_os_htons(ioim->iotag); m->io_tag = cpu_to_be16(ioim->iotag);
m->abort_tag = ++ioim->abort_tag; m->abort_tag = ++ioim->abort_tag;
/** /**
...@@ -2739,7 +2739,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2739,7 +2739,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
u16 iotag; u16 iotag;
enum bfa_ioim_event evt = BFA_IOIM_SM_COMP; enum bfa_ioim_event evt = BFA_IOIM_SM_COMP;
iotag = bfa_os_ntohs(rsp->io_tag); iotag = be16_to_cpu(rsp->io_tag);
ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
bfa_assert(ioim->iotag == iotag); bfa_assert(ioim->iotag == iotag);
...@@ -2822,7 +2822,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -2822,7 +2822,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
struct bfa_ioim_s *ioim; struct bfa_ioim_s *ioim;
u16 iotag; u16 iotag;
iotag = bfa_os_ntohs(rsp->io_tag); iotag = be16_to_cpu(rsp->io_tag);
ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
bfa_assert(ioim->iotag == iotag); bfa_assert(ioim->iotag == iotag);
...@@ -3380,7 +3380,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim) ...@@ -3380,7 +3380,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim)
bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ, bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ,
bfa_lpuid(tskim->bfa)); bfa_lpuid(tskim->bfa));
m->tsk_tag = bfa_os_htons(tskim->tsk_tag); m->tsk_tag = cpu_to_be16(tskim->tsk_tag);
m->itn_fhdl = tskim->itnim->rport->fw_handle; m->itn_fhdl = tskim->itnim->rport->fw_handle;
m->t_secs = tskim->tsecs; m->t_secs = tskim->tsecs;
m->lun = tskim->lun; m->lun = tskim->lun;
...@@ -3415,7 +3415,7 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim) ...@@ -3415,7 +3415,7 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim)
bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ, bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ,
bfa_lpuid(tskim->bfa)); bfa_lpuid(tskim->bfa));
m->tsk_tag = bfa_os_htons(tskim->tsk_tag); m->tsk_tag = cpu_to_be16(tskim->tsk_tag);
/** /**
* queue I/O message to firmware * queue I/O message to firmware
...@@ -3535,7 +3535,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) ...@@ -3535,7 +3535,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
struct bfi_tskim_rsp_s *rsp = (struct bfi_tskim_rsp_s *) m; struct bfi_tskim_rsp_s *rsp = (struct bfi_tskim_rsp_s *) m;
struct bfa_tskim_s *tskim; struct bfa_tskim_s *tskim;
u16 tsk_tag = bfa_os_ntohs(rsp->tsk_tag); u16 tsk_tag = be16_to_cpu(rsp->tsk_tag);
tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag);
bfa_assert(tskim->tsk_tag == tsk_tag); bfa_assert(tskim->tsk_tag == tsk_tag);
......
...@@ -1329,7 +1329,7 @@ bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric, ...@@ -1329,7 +1329,7 @@ bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
return; return;
} }
fabric->bb_credit = bfa_os_ntohs(flogi->csp.bbcred); fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
bport->port_topo.pn2n.rem_port_wwn = flogi->port_name; bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
bport->port_topo.pn2n.reply_oxid = fchs->ox_id; bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
......
This diff is collapsed.
...@@ -1621,7 +1621,7 @@ bfa_fcs_rport_gidpn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, ...@@ -1621,7 +1621,7 @@ bfa_fcs_rport_gidpn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
bfa_trc(rport->fcs, rport->pwwn); bfa_trc(rport->fcs, rport->pwwn);
cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp); cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code); cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
/* Check if the pid is the same as before. */ /* Check if the pid is the same as before. */
...@@ -1691,7 +1691,7 @@ bfa_fcs_rport_gpnid_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, ...@@ -1691,7 +1691,7 @@ bfa_fcs_rport_gpnid_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
bfa_trc(rport->fcs, rport->pwwn); bfa_trc(rport->fcs, rport->pwwn);
cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp); cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code); cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED); bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED);
...@@ -2123,9 +2123,9 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi) ...@@ -2123,9 +2123,9 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
* - MAX receive frame size * - MAX receive frame size
*/ */
rport->cisc = plogi->csp.cisc; rport->cisc = plogi->csp.cisc;
rport->maxfrsize = bfa_os_ntohs(plogi->class3.rxsz); rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz);
bfa_trc(port->fcs, bfa_os_ntohs(plogi->csp.bbcred)); bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
bfa_trc(port->fcs, port->fabric->bb_credit); bfa_trc(port->fcs, port->fabric->bb_credit);
/** /**
* Direct Attach P2P mode : * Direct Attach P2P mode :
...@@ -2136,12 +2136,12 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi) ...@@ -2136,12 +2136,12 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
* in PLOGI. * in PLOGI.
*/ */
if ((!bfa_fcs_fabric_is_switched(port->fabric)) && if ((!bfa_fcs_fabric_is_switched(port->fabric)) &&
(bfa_os_ntohs(plogi->csp.bbcred) < port->fabric->bb_credit)) { (be16_to_cpu(plogi->csp.bbcred) < port->fabric->bb_credit)) {
bfa_trc(port->fcs, bfa_os_ntohs(plogi->csp.bbcred)); bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
bfa_trc(port->fcs, port->fabric->bb_credit); bfa_trc(port->fcs, port->fabric->bb_credit);
port->fabric->bb_credit = bfa_os_ntohs(plogi->csp.bbcred); port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred);
bfa_fcport_set_tx_bbcredit(port->fcs->bfa, bfa_fcport_set_tx_bbcredit(port->fcs->bfa,
port->fabric->bb_credit); port->fabric->bb_credit);
} }
...@@ -3090,16 +3090,16 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, ...@@ -3090,16 +3090,16 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
rpsc2_acc = (struct fc_rpsc2_acc_s *) BFA_FCXP_RSP_PLD(fcxp); rpsc2_acc = (struct fc_rpsc2_acc_s *) BFA_FCXP_RSP_PLD(fcxp);
if (rpsc2_acc->els_cmd == FC_ELS_ACC) { if (rpsc2_acc->els_cmd == FC_ELS_ACC) {
rport->stats.rpsc_accs++; rport->stats.rpsc_accs++;
num_ents = bfa_os_ntohs(rpsc2_acc->num_pids); num_ents = be16_to_cpu(rpsc2_acc->num_pids);
bfa_trc(rport->fcs, num_ents); bfa_trc(rport->fcs, num_ents);
if (num_ents > 0) { if (num_ents > 0) {
bfa_assert(rpsc2_acc->port_info[0].pid != rport->pid); bfa_assert(rpsc2_acc->port_info[0].pid != rport->pid);
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].pid)); be16_to_cpu(rpsc2_acc->port_info[0].pid));
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].speed)); be16_to_cpu(rpsc2_acc->port_info[0].speed));
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].index)); be16_to_cpu(rpsc2_acc->port_info[0].index));
bfa_trc(rport->fcs, bfa_trc(rport->fcs,
rpsc2_acc->port_info[0].type); rpsc2_acc->port_info[0].type);
...@@ -3109,7 +3109,7 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, ...@@ -3109,7 +3109,7 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
} }
rpf->rpsc_speed = fc_rpsc_operspeed_to_bfa_speed( rpf->rpsc_speed = fc_rpsc_operspeed_to_bfa_speed(
bfa_os_ntohs(rpsc2_acc->port_info[0].speed)); be16_to_cpu(rpsc2_acc->port_info[0].speed));
bfa_sm_send_event(rpf, RPFSM_EVENT_RPSC_COMP); bfa_sm_send_event(rpf, RPFSM_EVENT_RPSC_COMP);
} }
......
...@@ -1450,7 +1450,7 @@ bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len) ...@@ -1450,7 +1450,7 @@ bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len)
*/ */
for (i = 0; i < len / sizeof(u32); i++) for (i = 0; i < len / sizeof(u32); i++)
bfa_reg_write(ioc->ioc_regs.hfn_mbox + i * sizeof(u32), bfa_reg_write(ioc->ioc_regs.hfn_mbox + i * sizeof(u32),
bfa_os_wtole(msgp[i])); cpu_to_le32(msgp[i]));
for (; i < BFI_IOC_MSGLEN_MAX / sizeof(u32); i++) for (; i < BFI_IOC_MSGLEN_MAX / sizeof(u32); i++)
bfa_reg_write(ioc->ioc_regs.hfn_mbox + i * sizeof(u32), 0); bfa_reg_write(ioc->ioc_regs.hfn_mbox + i * sizeof(u32), 0);
...@@ -1472,7 +1472,7 @@ bfa_ioc_send_enable(struct bfa_ioc_s *ioc) ...@@ -1472,7 +1472,7 @@ bfa_ioc_send_enable(struct bfa_ioc_s *ioc)
bfa_ioc_portid(ioc)); bfa_ioc_portid(ioc));
enable_req.ioc_class = ioc->ioc_mc; enable_req.ioc_class = ioc->ioc_mc;
bfa_os_gettimeofday(&tv); bfa_os_gettimeofday(&tv);
enable_req.tv_sec = bfa_os_ntohl(tv.tv_sec); enable_req.tv_sec = be32_to_cpu(tv.tv_sec);
bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s)); bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s));
} }
...@@ -1609,9 +1609,9 @@ bfa_ioc_getattr_reply(struct bfa_ioc_s *ioc) ...@@ -1609,9 +1609,9 @@ bfa_ioc_getattr_reply(struct bfa_ioc_s *ioc)
{ {
struct bfi_ioc_attr_s *attr = ioc->attr; struct bfi_ioc_attr_s *attr = ioc->attr;
attr->adapter_prop = bfa_os_ntohl(attr->adapter_prop); attr->adapter_prop = be32_to_cpu(attr->adapter_prop);
attr->card_type = bfa_os_ntohl(attr->card_type); attr->card_type = be32_to_cpu(attr->card_type);
attr->maxfrsize = bfa_os_ntohs(attr->maxfrsize); attr->maxfrsize = be16_to_cpu(attr->maxfrsize);
bfa_fsm_send_event(ioc, IOC_E_FWRSP_GETATTR); bfa_fsm_send_event(ioc, IOC_E_FWRSP_GETATTR);
} }
...@@ -1710,7 +1710,7 @@ bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz) ...@@ -1710,7 +1710,7 @@ bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz)
bfa_trc(ioc, len); bfa_trc(ioc, len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
r32 = bfa_mem_read(ioc->ioc_regs.smem_page_start, loff); r32 = bfa_mem_read(ioc->ioc_regs.smem_page_start, loff);
buf[i] = bfa_os_ntohl(r32); buf[i] = be32_to_cpu(r32);
loff += sizeof(u32); loff += sizeof(u32);
/** /**
...@@ -1925,7 +1925,7 @@ bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg) ...@@ -1925,7 +1925,7 @@ bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
i++) { i++) {
r32 = bfa_reg_read(ioc->ioc_regs.lpu_mbox + r32 = bfa_reg_read(ioc->ioc_regs.lpu_mbox +
i * sizeof(u32)); i * sizeof(u32));
msgp[i] = bfa_os_htonl(r32); msgp[i] = cpu_to_be32(r32);
} }
/** /**
......
...@@ -125,8 +125,8 @@ __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa) ...@@ -125,8 +125,8 @@ __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa)
static inline void static inline void
__bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa)
{ {
dma_addr->a32.addr_lo = (u32) bfa_os_htonl(pa); dma_addr->a32.addr_lo = (u32) cpu_to_be32(pa);
dma_addr->a32.addr_hi = (u32) bfa_os_htonl(bfa_os_u32(pa)); dma_addr->a32.addr_hi = (u32) cpu_to_be32(bfa_os_u32(pa));
} }
struct bfa_ioc_regs_s { struct bfa_ioc_regs_s {
......
...@@ -65,16 +65,6 @@ do { \ ...@@ -65,16 +65,6 @@ do { \
((_x) & 0x00ff00) | \ ((_x) & 0x00ff00) | \
(((_x) & 0xff0000) >> 16)) (((_x) & 0xff0000) >> 16))
#define bfa_swap_8b(_x) \
((((_x) & 0xff00000000000000ull) >> 56) \
| (((_x) & 0x00ff000000000000ull) >> 40) \
| (((_x) & 0x0000ff0000000000ull) >> 24) \
| (((_x) & 0x000000ff00000000ull) >> 8) \
| (((_x) & 0x00000000ff000000ull) << 8) \
| (((_x) & 0x0000000000ff0000ull) << 24) \
| (((_x) & 0x000000000000ff00ull) << 40) \
| (((_x) & 0x00000000000000ffull) << 56))
#define bfa_os_swap32(_x) \ #define bfa_os_swap32(_x) \
((((_x) & 0xff) << 24) | \ ((((_x) & 0xff) << 24) | \
(((_x) & 0x0000ff00) << 8) | \ (((_x) & 0x0000ff00) << 8) | \
...@@ -92,32 +82,15 @@ do { \ ...@@ -92,32 +82,15 @@ do { \
(((u64)(_x) & (u64)0xff00000000000000ull) >> 32))) (((u64)(_x) & (u64)0xff00000000000000ull) >> 32)))
#ifndef __BIGENDIAN #ifndef __BIGENDIAN
#define bfa_os_htons(_x) ((u16)((((_x) & 0xff00) >> 8) | \
(((_x) & 0x00ff) << 8)))
#define bfa_os_htonl(_x) bfa_os_swap32(_x)
#define bfa_os_htonll(_x) bfa_swap_8b(_x)
#define bfa_os_hton3b(_x) bfa_swap_3b(_x) #define bfa_os_hton3b(_x) bfa_swap_3b(_x)
#define bfa_os_wtole(_x) (_x)
#define bfa_os_sgaddr(_x) (_x) #define bfa_os_sgaddr(_x) (_x)
#else #else
#define bfa_os_htons(_x) (_x)
#define bfa_os_htonl(_x) (_x)
#define bfa_os_hton3b(_x) (_x) #define bfa_os_hton3b(_x) (_x)
#define bfa_os_htonll(_x) (_x)
#define bfa_os_wtole(_x) bfa_os_swap32(_x)
#define bfa_os_sgaddr(_x) bfa_os_swap_sgaddr(_x) #define bfa_os_sgaddr(_x) bfa_os_swap_sgaddr(_x)
#endif #endif
#define bfa_os_ntohs(_x) bfa_os_htons(_x)
#define bfa_os_ntohl(_x) bfa_os_htonl(_x)
#define bfa_os_ntohll(_x) bfa_os_htonll(_x)
#define bfa_os_ntoh3b(_x) bfa_os_hton3b(_x) #define bfa_os_ntoh3b(_x) bfa_os_hton3b(_x)
#define bfa_os_u32(__pa64) ((__pa64) >> 32) #define bfa_os_u32(__pa64) ((__pa64) >> 32)
#define bfa_os_addr_t void __iomem * #define bfa_os_addr_t void __iomem *
#define bfa_os_reg_read(_raddr) readl(_raddr) #define bfa_os_reg_read(_raddr) readl(_raddr)
......
...@@ -37,11 +37,11 @@ bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) ...@@ -37,11 +37,11 @@ bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats)
t0 = dip[i]; t0 = dip[i];
t1 = dip[i + 1]; t1 = dip[i + 1];
#ifdef __BIGENDIAN #ifdef __BIGENDIAN
dip[i] = bfa_os_ntohl(t0); dip[i] = be32_to_cpu(t0);
dip[i + 1] = bfa_os_ntohl(t1); dip[i + 1] = be32_to_cpu(t1);
#else #else
dip[i] = bfa_os_ntohl(t1); dip[i] = be32_to_cpu(t1);
dip[i + 1] = bfa_os_ntohl(t0); dip[i + 1] = be32_to_cpu(t0);
#endif #endif
} }
} }
......
...@@ -740,11 +740,11 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp) ...@@ -740,11 +740,11 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp)
{ {
struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
struct bfa_fcxp_s *fcxp; struct bfa_fcxp_s *fcxp;
u16 fcxp_tag = bfa_os_ntohs(fcxp_rsp->fcxp_tag); u16 fcxp_tag = be16_to_cpu(fcxp_rsp->fcxp_tag);
bfa_trc(bfa, fcxp_tag); bfa_trc(bfa, fcxp_tag);
fcxp_rsp->rsp_len = bfa_os_ntohl(fcxp_rsp->rsp_len); fcxp_rsp->rsp_len = be32_to_cpu(fcxp_rsp->rsp_len);
/** /**
* @todo f/w should not set residue to non-0 when everything * @todo f/w should not set residue to non-0 when everything
...@@ -753,7 +753,7 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp) ...@@ -753,7 +753,7 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp)
if (fcxp_rsp->req_status == BFA_STATUS_OK) if (fcxp_rsp->req_status == BFA_STATUS_OK)
fcxp_rsp->residue_len = 0; fcxp_rsp->residue_len = 0;
else else
fcxp_rsp->residue_len = bfa_os_ntohl(fcxp_rsp->residue_len); fcxp_rsp->residue_len = be32_to_cpu(fcxp_rsp->residue_len);
fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag);
...@@ -884,26 +884,26 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req) ...@@ -884,26 +884,26 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req)
bfi_h2i_set(send_req->mh, BFI_MC_FCXP, BFI_FCXP_H2I_SEND_REQ, bfi_h2i_set(send_req->mh, BFI_MC_FCXP, BFI_FCXP_H2I_SEND_REQ,
bfa_lpuid(bfa)); bfa_lpuid(bfa));
send_req->fcxp_tag = bfa_os_htons(fcxp->fcxp_tag); send_req->fcxp_tag = cpu_to_be16(fcxp->fcxp_tag);
if (rport) { if (rport) {
send_req->rport_fw_hndl = rport->fw_handle; send_req->rport_fw_hndl = rport->fw_handle;
send_req->max_frmsz = bfa_os_htons(rport->rport_info.max_frmsz); send_req->max_frmsz = cpu_to_be16(rport->rport_info.max_frmsz);
if (send_req->max_frmsz == 0) if (send_req->max_frmsz == 0)
send_req->max_frmsz = bfa_os_htons(FC_MAX_PDUSZ); send_req->max_frmsz = cpu_to_be16(FC_MAX_PDUSZ);
} else { } else {
send_req->rport_fw_hndl = 0; send_req->rport_fw_hndl = 0;
send_req->max_frmsz = bfa_os_htons(FC_MAX_PDUSZ); send_req->max_frmsz = cpu_to_be16(FC_MAX_PDUSZ);
} }
send_req->vf_id = bfa_os_htons(reqi->vf_id); send_req->vf_id = cpu_to_be16(reqi->vf_id);
send_req->lp_tag = reqi->lp_tag; send_req->lp_tag = reqi->lp_tag;
send_req->class = reqi->class; send_req->class = reqi->class;
send_req->rsp_timeout = rspi->rsp_timeout; send_req->rsp_timeout = rspi->rsp_timeout;
send_req->cts = reqi->cts; send_req->cts = reqi->cts;
send_req->fchs = reqi->fchs; send_req->fchs = reqi->fchs;
send_req->req_len = bfa_os_htonl(reqi->req_tot_len); send_req->req_len = cpu_to_be32(reqi->req_tot_len);
send_req->rsp_maxlen = bfa_os_htonl(rspi->rsp_maxlen); send_req->rsp_maxlen = cpu_to_be32(rspi->rsp_maxlen);
/* /*
* setup req sgles * setup req sgles
...@@ -1549,7 +1549,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp) ...@@ -1549,7 +1549,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
lps->fport = rsp->f_port; lps->fport = rsp->f_port;
lps->npiv_en = rsp->npiv_en; lps->npiv_en = rsp->npiv_en;
lps->lp_pid = rsp->lp_pid; lps->lp_pid = rsp->lp_pid;
lps->pr_bbcred = bfa_os_ntohs(rsp->bb_credit); lps->pr_bbcred = be16_to_cpu(rsp->bb_credit);
lps->pr_pwwn = rsp->port_name; lps->pr_pwwn = rsp->port_name;
lps->pr_nwwn = rsp->node_name; lps->pr_nwwn = rsp->node_name;
lps->auth_req = rsp->auth_req; lps->auth_req = rsp->auth_req;
...@@ -1647,7 +1647,7 @@ bfa_lps_send_login(struct bfa_lps_s *lps) ...@@ -1647,7 +1647,7 @@ bfa_lps_send_login(struct bfa_lps_s *lps)
m->lp_tag = lps->lp_tag; m->lp_tag = lps->lp_tag;
m->alpa = lps->alpa; m->alpa = lps->alpa;
m->pdu_size = bfa_os_htons(lps->pdusz); m->pdu_size = cpu_to_be16(lps->pdusz);
m->pwwn = lps->pwwn; m->pwwn = lps->pwwn;
m->nwwn = lps->nwwn; m->nwwn = lps->nwwn;
m->fdisc = lps->fdisc; m->fdisc = lps->fdisc;
...@@ -2995,7 +2995,7 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) ...@@ -2995,7 +2995,7 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport)
trunk->attr.state = BFA_TRUNK_DISABLED; trunk->attr.state = BFA_TRUNK_DISABLED;
/* update FCoE specific */ /* update FCoE specific */
fcport->fcoe_vlan = bfa_os_ntohs(pevent->link_state.vc_fcf.fcf.vlan); fcport->fcoe_vlan = be16_to_cpu(pevent->link_state.vc_fcf.fcf.vlan);
bfa_trc(fcport->bfa, fcport->speed); bfa_trc(fcport->bfa, fcport->speed);
bfa_trc(fcport->bfa, fcport->topology); bfa_trc(fcport->bfa, fcport->topology);
...@@ -3038,7 +3038,7 @@ bfa_fcport_send_enable(struct bfa_fcport_s *fcport) ...@@ -3038,7 +3038,7 @@ bfa_fcport_send_enable(struct bfa_fcport_s *fcport)
m->pwwn = fcport->pwwn; m->pwwn = fcport->pwwn;
m->port_cfg = fcport->cfg; m->port_cfg = fcport->cfg;
m->msgtag = fcport->msgtag; m->msgtag = fcport->msgtag;
m->port_cfg.maxfrsize = bfa_os_htons(fcport->cfg.maxfrsize); m->port_cfg.maxfrsize = cpu_to_be16(fcport->cfg.maxfrsize);
bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa);
bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo);
bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi);
...@@ -3114,7 +3114,7 @@ bfa_fcport_send_txcredit(void *port_cbarg) ...@@ -3114,7 +3114,7 @@ bfa_fcport_send_txcredit(void *port_cbarg)
bfi_h2i_set(m->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ, bfi_h2i_set(m->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ,
bfa_lpuid(fcport->bfa)); bfa_lpuid(fcport->bfa));
m->tx_bbcredit = bfa_os_htons((u16)fcport->cfg.tx_bbcredit); m->tx_bbcredit = cpu_to_be16((u16)fcport->cfg.tx_bbcredit);
/** /**
* queue I/O message to firmware * queue I/O message to firmware
...@@ -3132,7 +3132,7 @@ bfa_fcport_qos_stats_swap(struct bfa_qos_stats_s *d, ...@@ -3132,7 +3132,7 @@ bfa_fcport_qos_stats_swap(struct bfa_qos_stats_s *d,
/* Now swap the 32 bit fields */ /* Now swap the 32 bit fields */
for (i = 0; i < (sizeof(struct bfa_qos_stats_s)/sizeof(u32)); ++i) for (i = 0; i < (sizeof(struct bfa_qos_stats_s)/sizeof(u32)); ++i)
dip[i] = bfa_os_ntohl(sip[i]); dip[i] = be32_to_cpu(sip[i]);
} }
static void static void
...@@ -3146,11 +3146,11 @@ bfa_fcport_fcoe_stats_swap(struct bfa_fcoe_stats_s *d, ...@@ -3146,11 +3146,11 @@ bfa_fcport_fcoe_stats_swap(struct bfa_fcoe_stats_s *d,
for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32)); for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32));
i = i + 2) { i = i + 2) {
#ifdef __BIGENDIAN #ifdef __BIGENDIAN
dip[i] = bfa_os_ntohl(sip[i]); dip[i] = be32_to_cpu(sip[i]);
dip[i + 1] = bfa_os_ntohl(sip[i + 1]); dip[i + 1] = be32_to_cpu(sip[i + 1]);
#else #else
dip[i] = bfa_os_ntohl(sip[i + 1]); dip[i] = be32_to_cpu(sip[i + 1]);
dip[i + 1] = bfa_os_ntohl(sip[i]); dip[i + 1] = be32_to_cpu(sip[i]);
#endif #endif
} }
} }
...@@ -3325,7 +3325,7 @@ bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) ...@@ -3325,7 +3325,7 @@ bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn)
lattr->trunk_wwn = tlink->trunk_wwn; lattr->trunk_wwn = tlink->trunk_wwn;
lattr->fctl = tlink->fctl; lattr->fctl = tlink->fctl;
lattr->speed = tlink->speed; lattr->speed = tlink->speed;
lattr->deskew = bfa_os_ntohl(tlink->deskew); lattr->deskew = be32_to_cpu(tlink->deskew);
if (tlink->state == BFA_TRUNK_LINK_STATE_UP) { if (tlink->state == BFA_TRUNK_LINK_STATE_UP) {
fcport->speed = tlink->speed; fcport->speed = tlink->speed;
...@@ -3874,7 +3874,7 @@ bfa_fcport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr) ...@@ -3874,7 +3874,7 @@ bfa_fcport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr)
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
qos_attr->state = fcport->qos_attr.state; qos_attr->state = fcport->qos_attr.state;
qos_attr->total_bb_cr = bfa_os_ntohl(fcport->qos_attr.total_bb_cr); qos_attr->total_bb_cr = be32_to_cpu(fcport->qos_attr.total_bb_cr);
} }
void void
...@@ -3885,10 +3885,10 @@ bfa_fcport_qos_get_vc_attr(struct bfa_s *bfa, ...@@ -3885,10 +3885,10 @@ bfa_fcport_qos_get_vc_attr(struct bfa_s *bfa,
struct bfa_qos_vc_attr_s *bfa_vc_attr = &fcport->qos_vc_attr; struct bfa_qos_vc_attr_s *bfa_vc_attr = &fcport->qos_vc_attr;
u32 i = 0; u32 i = 0;
qos_vc_attr->total_vc_count = bfa_os_ntohs(bfa_vc_attr->total_vc_count); qos_vc_attr->total_vc_count = be16_to_cpu(bfa_vc_attr->total_vc_count);
qos_vc_attr->shared_credit = bfa_os_ntohs(bfa_vc_attr->shared_credit); qos_vc_attr->shared_credit = be16_to_cpu(bfa_vc_attr->shared_credit);
qos_vc_attr->elp_opmode_flags = qos_vc_attr->elp_opmode_flags =
bfa_os_ntohl(bfa_vc_attr->elp_opmode_flags); be32_to_cpu(bfa_vc_attr->elp_opmode_flags);
/* Individual VC info */ /* Individual VC info */
while (i < qos_vc_attr->total_vc_count) { while (i < qos_vc_attr->total_vc_count) {
...@@ -4273,9 +4273,9 @@ bfa_rport_sm_online(struct bfa_rport_s *rp, enum bfa_rport_event event) ...@@ -4273,9 +4273,9 @@ bfa_rport_sm_online(struct bfa_rport_s *rp, enum bfa_rport_event event)
bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_priority); bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_priority);
qos_scn->old_qos_attr.qos_flow_id = qos_scn->old_qos_attr.qos_flow_id =
bfa_os_ntohl(qos_scn->old_qos_attr.qos_flow_id); be32_to_cpu(qos_scn->old_qos_attr.qos_flow_id);
qos_scn->new_qos_attr.qos_flow_id = qos_scn->new_qos_attr.qos_flow_id =
bfa_os_ntohl(qos_scn->new_qos_attr.qos_flow_id); be32_to_cpu(qos_scn->new_qos_attr.qos_flow_id);
if (qos_scn->old_qos_attr.qos_flow_id != if (qos_scn->old_qos_attr.qos_flow_id !=
qos_scn->new_qos_attr.qos_flow_id) qos_scn->new_qos_attr.qos_flow_id)
...@@ -4697,7 +4697,7 @@ bfa_rport_send_fwcreate(struct bfa_rport_s *rp) ...@@ -4697,7 +4697,7 @@ bfa_rport_send_fwcreate(struct bfa_rport_s *rp)
bfi_h2i_set(m->mh, BFI_MC_RPORT, BFI_RPORT_H2I_CREATE_REQ, bfi_h2i_set(m->mh, BFI_MC_RPORT, BFI_RPORT_H2I_CREATE_REQ,
bfa_lpuid(rp->bfa)); bfa_lpuid(rp->bfa));
m->bfa_handle = rp->rport_tag; m->bfa_handle = rp->rport_tag;
m->max_frmsz = bfa_os_htons(rp->rport_info.max_frmsz); m->max_frmsz = cpu_to_be16(rp->rport_info.max_frmsz);
m->pid = rp->rport_info.pid; m->pid = rp->rport_info.pid;
m->lp_tag = rp->rport_info.lp_tag; m->lp_tag = rp->rport_info.lp_tag;
m->local_pid = rp->rport_info.local_pid; m->local_pid = rp->rport_info.local_pid;
...@@ -4888,7 +4888,7 @@ bfa_rport_get_qos_attr(struct bfa_rport_s *rport, ...@@ -4888,7 +4888,7 @@ bfa_rport_get_qos_attr(struct bfa_rport_s *rport,
struct bfa_rport_qos_attr_s *qos_attr) struct bfa_rport_qos_attr_s *qos_attr)
{ {
qos_attr->qos_priority = rport->qos_attr.qos_priority; qos_attr->qos_priority = rport->qos_attr.qos_priority;
qos_attr->qos_flow_id = bfa_os_ntohl(rport->qos_attr.qos_flow_id); qos_attr->qos_flow_id = be32_to_cpu(rport->qos_attr.qos_flow_id);
} }
...@@ -5155,7 +5155,7 @@ claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi) ...@@ -5155,7 +5155,7 @@ claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
uf_bp_msg->buf_tag = i; uf_bp_msg->buf_tag = i;
buf_len = sizeof(struct bfa_uf_buf_s); buf_len = sizeof(struct bfa_uf_buf_s);
uf_bp_msg->buf_len = bfa_os_htons(buf_len); uf_bp_msg->buf_len = cpu_to_be16(buf_len);
bfi_h2i_set(uf_bp_msg->mh, BFI_MC_UF, BFI_UF_H2I_BUF_POST, bfi_h2i_set(uf_bp_msg->mh, BFI_MC_UF, BFI_UF_H2I_BUF_POST,
bfa_lpuid(ufm->bfa)); bfa_lpuid(ufm->bfa));
...@@ -5308,8 +5308,8 @@ uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m) ...@@ -5308,8 +5308,8 @@ uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m)
u8 *buf = &uf_buf->d[0]; u8 *buf = &uf_buf->d[0];
struct fchs_s *fchs; struct fchs_s *fchs;
m->frm_len = bfa_os_ntohs(m->frm_len); m->frm_len = be16_to_cpu(m->frm_len);
m->xfr_len = bfa_os_ntohs(m->xfr_len); m->xfr_len = be16_to_cpu(m->xfr_len);
fchs = (struct fchs_s *)uf_buf; fchs = (struct fchs_s *)uf_buf;
......
...@@ -70,7 +70,7 @@ bfad_im_get_starget_node_name(struct scsi_target *starget) ...@@ -70,7 +70,7 @@ bfad_im_get_starget_node_name(struct scsi_target *starget)
if (itnim) if (itnim)
node_name = bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim); node_name = bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim);
fc_starget_node_name(starget) = bfa_os_htonll(node_name); fc_starget_node_name(starget) = cpu_to_be64(node_name);
spin_unlock_irqrestore(&bfad->bfad_lock, flags); spin_unlock_irqrestore(&bfad->bfad_lock, flags);
} }
...@@ -96,7 +96,7 @@ bfad_im_get_starget_port_name(struct scsi_target *starget) ...@@ -96,7 +96,7 @@ bfad_im_get_starget_port_name(struct scsi_target *starget)
if (itnim) if (itnim)
port_name = bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim); port_name = bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim);
fc_starget_port_name(starget) = bfa_os_htonll(port_name); fc_starget_port_name(starget) = cpu_to_be64(port_name);
spin_unlock_irqrestore(&bfad->bfad_lock, flags); spin_unlock_irqrestore(&bfad->bfad_lock, flags);
} }
...@@ -249,7 +249,7 @@ bfad_im_get_host_fabric_name(struct Scsi_Host *shost) ...@@ -249,7 +249,7 @@ bfad_im_get_host_fabric_name(struct Scsi_Host *shost)
fabric_nwwn = bfa_fcs_lport_get_fabric_name(port->fcs_port); fabric_nwwn = bfa_fcs_lport_get_fabric_name(port->fcs_port);
fc_host_fabric_name(shost) = bfa_os_htonll(fabric_nwwn); fc_host_fabric_name(shost) = cpu_to_be64(fabric_nwwn);
} }
...@@ -733,7 +733,7 @@ bfad_im_node_name_show(struct device *dev, struct device_attribute *attr, ...@@ -733,7 +733,7 @@ bfad_im_node_name_show(struct device *dev, struct device_attribute *attr,
u64 nwwn; u64 nwwn;
nwwn = bfa_fcs_lport_get_nwwn(port->fcs_port); nwwn = bfa_fcs_lport_get_nwwn(port->fcs_port);
return snprintf(buf, PAGE_SIZE, "0x%llx\n", bfa_os_htonll(nwwn)); return snprintf(buf, PAGE_SIZE, "0x%llx\n", cpu_to_be64(nwwn));
} }
static ssize_t static ssize_t
......
...@@ -949,9 +949,9 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port) ...@@ -949,9 +949,9 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
char symname[BFA_SYMNAME_MAXLEN]; char symname[BFA_SYMNAME_MAXLEN];
fc_host_node_name(host) = fc_host_node_name(host) =
bfa_os_htonll((bfa_fcs_lport_get_nwwn(port->fcs_port))); cpu_to_be64((bfa_fcs_lport_get_nwwn(port->fcs_port)));
fc_host_port_name(host) = fc_host_port_name(host) =
bfa_os_htonll((bfa_fcs_lport_get_pwwn(port->fcs_port))); cpu_to_be64((bfa_fcs_lport_get_pwwn(port->fcs_port)));
fc_host_max_npiv_vports(host) = bfa_lps_get_max_vport(&bfad->bfa); fc_host_max_npiv_vports(host) = bfa_lps_get_max_vport(&bfad->bfa);
fc_host_supported_classes(host) = FC_COS_CLASS3; fc_host_supported_classes(host) = FC_COS_CLASS3;
...@@ -983,9 +983,9 @@ bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim) ...@@ -983,9 +983,9 @@ bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim)
struct bfad_itnim_data_s *itnim_data; struct bfad_itnim_data_s *itnim_data;
rport_ids.node_name = rport_ids.node_name =
bfa_os_htonll(bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim)); cpu_to_be64(bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim));
rport_ids.port_name = rport_ids.port_name =
bfa_os_htonll(bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim)); cpu_to_be64(bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim));
rport_ids.port_id = rport_ids.port_id =
bfa_os_hton3b(bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim)); bfa_os_hton3b(bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim));
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment