diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 3ba33b1e6..8bf6d43c5 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -2215,7 +2215,7 @@ static int q24_build_ctio_pkt(struct q2t_prm *prm) ha->cmds[h-1] = prm->cmd; pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK; - pkt->common.nport_handle = prm->cmd->loop_id; + pkt->common.nport_handle = cpu_to_le16(prm->cmd->loop_id); pkt->common.timeout = cpu_to_le16(Q2T_TIMEOUT); pkt->common.initiator_id[0] = atio->fcp_hdr.s_id[2]; pkt->common.initiator_id[1] = atio->fcp_hdr.s_id[1]; diff --git a/qla2x00t/qla2x_tgt_def.h b/qla2x00t/qla2x_tgt_def.h index 4a65be5c6..64056e3d5 100644 --- a/qla2x00t/qla2x_tgt_def.h +++ b/qla2x00t/qla2x_tgt_def.h @@ -420,17 +420,28 @@ typedef struct { typedef struct { uint64_t lun; uint8_t cmnd_ref; +#ifdef __LITTLE_ENDIAN uint8_t task_attr:3; uint8_t reserved:5; +#else + uint8_t reserved:5; + uint8_t task_attr:3; +#endif uint8_t task_mgmt_flags; #define FCP_CMND_TASK_MGMT_CLEAR_ACA 6 #define FCP_CMND_TASK_MGMT_TARGET_RESET 5 #define FCP_CMND_TASK_MGMT_LU_RESET 4 #define FCP_CMND_TASK_MGMT_CLEAR_TASK_SET 2 #define FCP_CMND_TASK_MGMT_ABORT_TASK_SET 1 +#ifdef __LITTLE_ENDIAN uint8_t wrdata:1; uint8_t rddata:1; uint8_t add_cdb_len:6; +#else + uint8_t add_cdb_len:6; + uint8_t rddata:1; + uint8_t wrdata:1; +#endif uint8_t cdb[16]; /* * add_cdb is optional and can absent from fcp_cmnd_t. Size 4 only to @@ -449,8 +460,13 @@ typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t fcp_cmnd_len_low; +#ifdef __LITTLE_ENDIAN uint8_t fcp_cmnd_len_high:4; uint8_t attr:4; +#else + uint8_t attr:4; + uint8_t fcp_cmnd_len_high:4; +#endif uint32_t exchange_addr; #define ATIO_EXCHANGE_ADDRESS_UNKNOWN 0xFFFFFFFF fcp_hdr_t fcp_hdr; @@ -626,8 +642,13 @@ typedef struct { uint16_t nport_handle; uint8_t reserved_2[2]; uint8_t vp_index; +#ifdef __LITTLE_ENDIAN uint8_t reserved_3:4; uint8_t sof_type:4; +#else + uint8_t sof_type:4; + uint8_t reserved_3:4; +#endif uint32_t exchange_address; fcp_hdr_le_t fcp_hdr_le; uint8_t reserved_4[16]; @@ -668,8 +689,13 @@ typedef struct { uint16_t control_flags; #define ABTS_CONTR_FLG_TERM_EXCHG BIT_0 uint8_t vp_index; +#ifdef __LITTLE_ENDIAN uint8_t reserved_3:4; uint8_t sof_type:4; +#else + uint8_t sof_type:4; + uint8_t reserved_3:4; +#endif uint32_t exchange_address; fcp_hdr_le_t fcp_hdr_le; union { @@ -692,8 +718,13 @@ typedef struct { uint16_t nport_handle; uint16_t reserved_1; uint8_t reserved_2; +#ifdef __LITTLE_ENDIAN uint8_t reserved_3:4; uint8_t sof_type:4; +#else + uint8_t sof_type:4; + uint8_t reserved_3:4; +#endif uint32_t exchange_address; fcp_hdr_le_t fcp_hdr_le; uint8_t reserved_4[8]; diff --git a/qla2x00t/qla_init.c b/qla2x00t/qla_init.c index f74f77b5e..c8bf7810c 100644 --- a/qla2x00t/qla_init.c +++ b/qla2x00t/qla_init.c @@ -3769,7 +3769,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) } #endif /* out-of-order frames reassembly */ - nv->firmware_options_3 |= BIT_6|BIT_9; + nv->firmware_options_3 |= __constant_cpu_to_le32(BIT_6|BIT_9); if (ha->enable_class_2) { if (ha->flags.init_done) {