diff options
author | Jing Huang <huangj@brocade.com> | 2010-10-18 20:10:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 17:17:14 -0400 |
commit | ba816ea8e2eacbf3d198ad1859f413c2d6213434 (patch) | |
tree | 92399b02434b350fe4c767c0cb4f1790b7fee763 /drivers/scsi/bfa/bfa_fcpim.c | |
parent | 6a18b1675fdf08a6dc861e39c3f94309a03e7f16 (diff) |
[SCSI] bfa: replace endian swap macros with the ones provided by linux
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcpim.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index e9075a68e703..8c585bd855ed 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c | |||
@@ -2260,11 +2260,11 @@ __bfa_cb_ioim_comp(void *cbarg, bfa_boolean_t complete) | |||
2260 | * setup residue value correctly for normal completions | 2260 | * setup residue value correctly for normal completions |
2261 | */ | 2261 | */ |
2262 | if (m->resid_flags == FCP_RESID_UNDER) { | 2262 | if (m->resid_flags == FCP_RESID_UNDER) { |
2263 | residue = bfa_os_ntohl(m->residue); | 2263 | residue = be32_to_cpu(m->residue); |
2264 | bfa_stats(ioim->itnim, iocomp_underrun); | 2264 | bfa_stats(ioim->itnim, iocomp_underrun); |
2265 | } | 2265 | } |
2266 | if (m->resid_flags == FCP_RESID_OVER) { | 2266 | if (m->resid_flags == FCP_RESID_OVER) { |
2267 | residue = bfa_os_ntohl(m->residue); | 2267 | residue = be32_to_cpu(m->residue); |
2268 | residue = -residue; | 2268 | residue = -residue; |
2269 | bfa_stats(ioim->itnim, iocomp_overrun); | 2269 | bfa_stats(ioim->itnim, iocomp_overrun); |
2270 | } | 2270 | } |
@@ -2357,7 +2357,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2357 | /** | 2357 | /** |
2358 | * build i/o request message next | 2358 | * build i/o request message next |
2359 | */ | 2359 | */ |
2360 | m->io_tag = bfa_os_htons(ioim->iotag); | 2360 | m->io_tag = cpu_to_be16(ioim->iotag); |
2361 | m->rport_hdl = ioim->itnim->rport->fw_handle; | 2361 | m->rport_hdl = ioim->itnim->rport->fw_handle; |
2362 | m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio); | 2362 | m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio); |
2363 | 2363 | ||
@@ -2395,7 +2395,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2395 | m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio); | 2395 | m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio); |
2396 | m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio); | 2396 | m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio); |
2397 | fcp_dl = bfa_cb_ioim_get_size(ioim->dio); | 2397 | fcp_dl = bfa_cb_ioim_get_size(ioim->dio); |
2398 | m->cmnd.fcp_dl = bfa_os_htonl(fcp_dl); | 2398 | m->cmnd.fcp_dl = cpu_to_be32(fcp_dl); |
2399 | 2399 | ||
2400 | /** | 2400 | /** |
2401 | * set up I/O message header | 2401 | * set up I/O message header |
@@ -2436,7 +2436,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2436 | bfa_cb_ioim_get_cdb(ioim->dio) + 1, | 2436 | bfa_cb_ioim_get_cdb(ioim->dio) + 1, |
2437 | m->cmnd.addl_cdb_len * sizeof(u32)); | 2437 | m->cmnd.addl_cdb_len * sizeof(u32)); |
2438 | fcp_cmnd_fcpdl(&m->cmnd) = | 2438 | fcp_cmnd_fcpdl(&m->cmnd) = |
2439 | bfa_os_htonl(bfa_cb_ioim_get_size(ioim->dio)); | 2439 | cpu_to_be32(bfa_cb_ioim_get_size(ioim->dio)); |
2440 | } | 2440 | } |
2441 | #endif | 2441 | #endif |
2442 | 2442 | ||
@@ -2564,7 +2564,7 @@ bfa_ioim_send_abort(struct bfa_ioim_s *ioim) | |||
2564 | msgop = BFI_IOIM_H2I_IOCLEANUP_REQ; | 2564 | msgop = BFI_IOIM_H2I_IOCLEANUP_REQ; |
2565 | 2565 | ||
2566 | bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_lpuid(ioim->bfa)); | 2566 | bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_lpuid(ioim->bfa)); |
2567 | m->io_tag = bfa_os_htons(ioim->iotag); | 2567 | m->io_tag = cpu_to_be16(ioim->iotag); |
2568 | m->abort_tag = ++ioim->abort_tag; | 2568 | m->abort_tag = ++ioim->abort_tag; |
2569 | 2569 | ||
2570 | /** | 2570 | /** |
@@ -2739,7 +2739,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
2739 | u16 iotag; | 2739 | u16 iotag; |
2740 | enum bfa_ioim_event evt = BFA_IOIM_SM_COMP; | 2740 | enum bfa_ioim_event evt = BFA_IOIM_SM_COMP; |
2741 | 2741 | ||
2742 | iotag = bfa_os_ntohs(rsp->io_tag); | 2742 | iotag = be16_to_cpu(rsp->io_tag); |
2743 | 2743 | ||
2744 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); | 2744 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); |
2745 | bfa_assert(ioim->iotag == iotag); | 2745 | bfa_assert(ioim->iotag == iotag); |
@@ -2822,7 +2822,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
2822 | struct bfa_ioim_s *ioim; | 2822 | struct bfa_ioim_s *ioim; |
2823 | u16 iotag; | 2823 | u16 iotag; |
2824 | 2824 | ||
2825 | iotag = bfa_os_ntohs(rsp->io_tag); | 2825 | iotag = be16_to_cpu(rsp->io_tag); |
2826 | 2826 | ||
2827 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); | 2827 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); |
2828 | bfa_assert(ioim->iotag == iotag); | 2828 | bfa_assert(ioim->iotag == iotag); |
@@ -3380,7 +3380,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim) | |||
3380 | bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ, | 3380 | bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ, |
3381 | bfa_lpuid(tskim->bfa)); | 3381 | bfa_lpuid(tskim->bfa)); |
3382 | 3382 | ||
3383 | m->tsk_tag = bfa_os_htons(tskim->tsk_tag); | 3383 | m->tsk_tag = cpu_to_be16(tskim->tsk_tag); |
3384 | m->itn_fhdl = tskim->itnim->rport->fw_handle; | 3384 | m->itn_fhdl = tskim->itnim->rport->fw_handle; |
3385 | m->t_secs = tskim->tsecs; | 3385 | m->t_secs = tskim->tsecs; |
3386 | m->lun = tskim->lun; | 3386 | m->lun = tskim->lun; |
@@ -3415,7 +3415,7 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim) | |||
3415 | bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ, | 3415 | bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ, |
3416 | bfa_lpuid(tskim->bfa)); | 3416 | bfa_lpuid(tskim->bfa)); |
3417 | 3417 | ||
3418 | m->tsk_tag = bfa_os_htons(tskim->tsk_tag); | 3418 | m->tsk_tag = cpu_to_be16(tskim->tsk_tag); |
3419 | 3419 | ||
3420 | /** | 3420 | /** |
3421 | * queue I/O message to firmware | 3421 | * queue I/O message to firmware |
@@ -3535,7 +3535,7 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
3535 | struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); | 3535 | struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); |
3536 | struct bfi_tskim_rsp_s *rsp = (struct bfi_tskim_rsp_s *) m; | 3536 | struct bfi_tskim_rsp_s *rsp = (struct bfi_tskim_rsp_s *) m; |
3537 | struct bfa_tskim_s *tskim; | 3537 | struct bfa_tskim_s *tskim; |
3538 | u16 tsk_tag = bfa_os_ntohs(rsp->tsk_tag); | 3538 | u16 tsk_tag = be16_to_cpu(rsp->tsk_tag); |
3539 | 3539 | ||
3540 | tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); | 3540 | tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); |
3541 | bfa_assert(tskim->tsk_tag == tsk_tag); | 3541 | bfa_assert(tskim->tsk_tag == tsk_tag); |