From 9933c050fe919ed42408a6e0198e3d7e7d3278a8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 8 Aug 2019 20:02:01 -0700 Subject: scsi: qla2xxx: Make it explicit that ELS pass-through IOCBs use little endian According to the firmware documentation the firmware expects all ELS pass-through IOCB parameters in little endian format. Make this explicit. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen --- drivers/scsi/qla2xxx/qla_fw.h | 8 ++++---- drivers/scsi/qla2xxx/qla_iocb.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index df079a8c2b33..732bb871c433 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -761,13 +761,13 @@ struct els_entry_24xx { #define ECF_CLR_PASSTHRU_PEND BIT_12 #define ECF_INCL_FRAME_HDR BIT_11 - uint32_t rx_byte_count; - uint32_t tx_byte_count; + __le32 rx_byte_count; + __le32 tx_byte_count; __le64 tx_address __packed; /* Data segment 0 address. */ - uint32_t tx_len; /* Data segment 0 length. */ + __le32 tx_len; /* Data segment 0 length. */ __le64 rx_address __packed; /* Data segment 1 address. */ - uint32_t rx_len; /* Data segment 1 length. */ + __le32 rx_len; /* Data segment 1 length. */ }; struct els_sts_entry_24xx { diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 6b120254f414..c7b91827c1e7 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2704,12 +2704,12 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) if (elsio->u.els_logo.els_cmd == ELS_DCMD_PLOGI) { els_iocb->tx_byte_count = els_iocb->tx_len = - sizeof(struct els_plogi_payload); + cpu_to_le32(sizeof(struct els_plogi_payload)); put_unaligned_le64(elsio->u.els_plogi.els_plogi_pyld_dma, &els_iocb->tx_address); els_iocb->rx_dsd_count = 1; els_iocb->rx_byte_count = els_iocb->rx_len = - sizeof(struct els_plogi_payload); + cpu_to_le32(sizeof(struct els_plogi_payload)); put_unaligned_le64(elsio->u.els_plogi.els_resp_pyld_dma, &els_iocb->rx_address); @@ -2718,7 +2718,8 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) ql_dump_buffer(ql_log_info, vha, 0x0109, (uint8_t *)els_iocb, 0x70); } else { - els_iocb->tx_byte_count = sizeof(struct els_logo_payload); + els_iocb->tx_byte_count = + cpu_to_le32(sizeof(struct els_logo_payload)); put_unaligned_le64(elsio->u.els_logo.els_logo_pyld_dma, &els_iocb->tx_address); els_iocb->tx_len = cpu_to_le32(sizeof(struct els_logo_payload)); -- cgit v1.2.3