From: Mike Christie <mchristi@redhat.com> Date: Sat, 27 Nov 2010 02:31:28 -0500 Subject: [scsi] bnx2i: fix endian bug in TMF LUN cmd send Message-id: <1290825091-5914-2-git-send-email-mchristi@redhat.com> Patchwork-id: 29642 O-Subject: [RHEL 5.6 PATCH 1/4] bnx2i: Fixed the endian bug in the TMF LUN cmd send Bugzilla: 653991 RH-Acked-by: David S. Miller <davem@redhat.com> RH-Acked-by: Rob Evers <revers@redhat.com> From: Mike Christie <mchristi@redhat.com> This is for bz 653991. Added a be32_to_cpu call for the TMF LUN wqe. diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index df59102..4c61781 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -384,6 +384,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, struct bnx2i_cmd *bnx2i_cmd; struct bnx2i_tmf_request *tmfabort_wqe; u32 dword; + __be32 scsi_lun[2]; bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; tmfabort_hdr = (struct iscsi_tm *)mtask->hdr; @@ -425,7 +426,10 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, default: tmfabort_wqe->ref_itt = RESERVED_ITT; } - memcpy(tmfabort_wqe->lun, tmfabort_hdr->lun, sizeof(struct scsi_lun)); + memcpy(scsi_lun, tmfabort_hdr->lun, sizeof(struct scsi_lun)); + tmfabort_wqe->lun[0] = be32_to_cpu(scsi_lun[0]); + tmfabort_wqe->lun[1] = be32_to_cpu(scsi_lun[1]); + tmfabort_wqe->ref_cmd_sn = be32_to_cpu(tmfabort_hdr->refcmdsn); tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma;