diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 3e8165f4c..23fbf9191 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -2216,7 +2216,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 = __constant_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 889c1945a..867aa679f 100644 --- a/qla2x00t/qla2x_tgt_def.h +++ b/qla2x00t/qla2x_tgt_def.h @@ -417,17 +417,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 @@ -446,8 +457,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; @@ -623,8 +639,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]; @@ -665,8 +686,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 { @@ -689,8 +715,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) { diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 6a207cfab..c5d63a43f 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -2768,7 +2768,7 @@ void scst_pr_read_full_status(struct scst_cmd *cmd, uint8_t *buffer, if (dev->pr_is_set && scst_pr_is_holder(dev, reg)) { buffer[offset + 12] = 1; - buffer[offset + 13] = (dev->pr_scope << 8) | dev->pr_type; + buffer[offset + 13] = (dev->pr_scope << 4) | dev->pr_type; } put_unaligned(cpu_to_be16(reg->rel_tgt_id),