diff options
author | Saurav Kashyap <saurav.kashyap@qlogic.com> | 2013-06-25 11:27:21 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-07-08 12:22:52 -0400 |
commit | 1f8deefecdda5a43961dd8062a6cab27e20af5e9 (patch) | |
tree | fdb781afa822b08bfcef4e466dd5d28f570dff70 /drivers/scsi | |
parent | b8eb4136b08f24b159d76b273216d524a26ac8f9 (diff) |
[SCSI] qla2xxx: Fix sparse warning from qla_mr.c and qla_iocb.c.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 34 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_inline.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mr.c | 167 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mr.h | 98 |
6 files changed, 157 insertions, 150 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c32efc753229..95ca32a71e75 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -323,7 +323,7 @@ struct srb_iocb { | |||
323 | uint32_t lun; | 323 | uint32_t lun; |
324 | uint32_t data; | 324 | uint32_t data; |
325 | struct completion comp; | 325 | struct completion comp; |
326 | uint32_t comp_status; | 326 | __le16 comp_status; |
327 | } tmf; | 327 | } tmf; |
328 | struct { | 328 | struct { |
329 | #define SRB_FXDISC_REQ_DMA_VALID BIT_0 | 329 | #define SRB_FXDISC_REQ_DMA_VALID BIT_0 |
@@ -338,21 +338,21 @@ struct srb_iocb { | |||
338 | void *rsp_addr; | 338 | void *rsp_addr; |
339 | dma_addr_t req_dma_handle; | 339 | dma_addr_t req_dma_handle; |
340 | dma_addr_t rsp_dma_handle; | 340 | dma_addr_t rsp_dma_handle; |
341 | uint32_t adapter_id; | 341 | __le32 adapter_id; |
342 | uint32_t adapter_id_hi; | 342 | __le32 adapter_id_hi; |
343 | uint32_t req_func_type; | 343 | __le16 req_func_type; |
344 | uint32_t req_data; | 344 | __le32 req_data; |
345 | uint32_t req_data_extra; | 345 | __le32 req_data_extra; |
346 | uint32_t result; | 346 | __le32 result; |
347 | uint32_t seq_number; | 347 | __le32 seq_number; |
348 | uint32_t fw_flags; | 348 | __le16 fw_flags; |
349 | struct completion fxiocb_comp; | 349 | struct completion fxiocb_comp; |
350 | uint32_t reserved_0; | 350 | __le32 reserved_0; |
351 | uint8_t reserved_1; | 351 | uint8_t reserved_1; |
352 | } fxiocb; | 352 | } fxiocb; |
353 | struct { | 353 | struct { |
354 | uint32_t cmd_hndl; | 354 | uint32_t cmd_hndl; |
355 | uint32_t comp_status; | 355 | __le16 comp_status; |
356 | struct completion comp; | 356 | struct completion comp; |
357 | } abt; | 357 | } abt; |
358 | } u; | 358 | } u; |
@@ -1196,14 +1196,14 @@ typedef struct { | |||
1196 | struct init_cb_fx { | 1196 | struct init_cb_fx { |
1197 | uint16_t version; | 1197 | uint16_t version; |
1198 | uint16_t reserved_1[13]; | 1198 | uint16_t reserved_1[13]; |
1199 | uint16_t request_q_outpointer; | 1199 | __le16 request_q_outpointer; |
1200 | uint16_t response_q_inpointer; | 1200 | __le16 response_q_inpointer; |
1201 | uint16_t reserved_2[2]; | 1201 | uint16_t reserved_2[2]; |
1202 | uint16_t response_q_length; | 1202 | __le16 response_q_length; |
1203 | uint16_t request_q_length; | 1203 | __le16 request_q_length; |
1204 | uint16_t reserved_3[2]; | 1204 | uint16_t reserved_3[2]; |
1205 | uint32_t request_q_address[2]; | 1205 | __le32 request_q_address[2]; |
1206 | uint32_t response_q_address[2]; | 1206 | __le32 response_q_address[2]; |
1207 | uint16_t reserved_4[4]; | 1207 | uint16_t reserved_4[4]; |
1208 | uint8_t response_q_msivec; | 1208 | uint8_t response_q_msivec; |
1209 | uint8_t reserved_5[19]; | 1209 | uint8_t reserved_5[19]; |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 026bfde33e67..2d98232a08eb 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -587,7 +587,7 @@ extern int qlafx00_init_firmware(scsi_qla_host_t *, uint16_t); | |||
587 | extern int qlafx00_fw_ready(scsi_qla_host_t *); | 587 | extern int qlafx00_fw_ready(scsi_qla_host_t *); |
588 | extern int qlafx00_configure_devices(scsi_qla_host_t *); | 588 | extern int qlafx00_configure_devices(scsi_qla_host_t *); |
589 | extern int qlafx00_reset_initialize(scsi_qla_host_t *); | 589 | extern int qlafx00_reset_initialize(scsi_qla_host_t *); |
590 | extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint8_t); | 590 | extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint16_t); |
591 | extern int qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *); | 591 | extern int qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *); |
592 | extern int qlafx00_post_aenfx_work(struct scsi_qla_host *, uint32_t, | 592 | extern int qlafx00_post_aenfx_work(struct scsi_qla_host *, uint32_t, |
593 | uint32_t *, int); | 593 | uint32_t *, int); |
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 0a5c8951cebb..28c38b4929ce 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h | |||
@@ -83,7 +83,7 @@ static inline void | |||
83 | host_to_adap(uint8_t *src, uint8_t *dst, uint32_t bsize) | 83 | host_to_adap(uint8_t *src, uint8_t *dst, uint32_t bsize) |
84 | { | 84 | { |
85 | uint32_t *isrc = (uint32_t *) src; | 85 | uint32_t *isrc = (uint32_t *) src; |
86 | uint32_t *odest = (uint32_t *) dst; | 86 | __le32 *odest = (__le32 *) dst; |
87 | uint32_t iter = bsize >> 2; | 87 | uint32_t iter = bsize >> 2; |
88 | 88 | ||
89 | for (; iter ; iter--) | 89 | for (; iter ; iter--) |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 15e4080b347c..9de372f00d4a 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -1863,8 +1863,8 @@ skip_cmd_array: | |||
1863 | pkt = req->ring_ptr; | 1863 | pkt = req->ring_ptr; |
1864 | memset(pkt, 0, REQUEST_ENTRY_SIZE); | 1864 | memset(pkt, 0, REQUEST_ENTRY_SIZE); |
1865 | if (IS_QLAFX00(ha)) { | 1865 | if (IS_QLAFX00(ha)) { |
1866 | WRT_REG_BYTE(&pkt->entry_count, req_cnt); | 1866 | WRT_REG_BYTE((void __iomem *)&pkt->entry_count, req_cnt); |
1867 | WRT_REG_WORD(&pkt->handle, handle); | 1867 | WRT_REG_WORD((void __iomem *)&pkt->handle, handle); |
1868 | } else { | 1868 | } else { |
1869 | pkt->entry_count = req_cnt; | 1869 | pkt->entry_count = req_cnt; |
1870 | pkt->handle = handle; | 1870 | pkt->handle = handle; |
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index a6df55838365..d7993797f46e 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c | |||
@@ -707,7 +707,7 @@ qlafx00_tmf_iocb_timeout(void *data) | |||
707 | srb_t *sp = (srb_t *)data; | 707 | srb_t *sp = (srb_t *)data; |
708 | struct srb_iocb *tmf = &sp->u.iocb_cmd; | 708 | struct srb_iocb *tmf = &sp->u.iocb_cmd; |
709 | 709 | ||
710 | tmf->u.tmf.comp_status = CS_TIMEOUT; | 710 | tmf->u.tmf.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT); |
711 | complete(&tmf->u.tmf.comp); | 711 | complete(&tmf->u.tmf.comp); |
712 | } | 712 | } |
713 | 713 | ||
@@ -1418,7 +1418,8 @@ qlafx00_init_response_q_entries(struct rsp_que *rsp) | |||
1418 | pkt = rsp->ring_ptr; | 1418 | pkt = rsp->ring_ptr; |
1419 | for (cnt = 0; cnt < rsp->length; cnt++) { | 1419 | for (cnt = 0; cnt < rsp->length; cnt++) { |
1420 | pkt->signature = RESPONSE_PROCESSED; | 1420 | pkt->signature = RESPONSE_PROCESSED; |
1421 | WRT_REG_DWORD(&pkt->signature, RESPONSE_PROCESSED); | 1421 | WRT_REG_DWORD((void __iomem *)&pkt->signature, |
1422 | RESPONSE_PROCESSED); | ||
1422 | pkt++; | 1423 | pkt++; |
1423 | } | 1424 | } |
1424 | } | 1425 | } |
@@ -1733,7 +1734,7 @@ qla2x00_fxdisc_sp_done(void *data, void *ptr, int res) | |||
1733 | } | 1734 | } |
1734 | 1735 | ||
1735 | int | 1736 | int |
1736 | qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type) | 1737 | qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) |
1737 | { | 1738 | { |
1738 | srb_t *sp; | 1739 | srb_t *sp; |
1739 | struct srb_iocb *fdisc; | 1740 | struct srb_iocb *fdisc; |
@@ -1759,13 +1760,13 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type) | |||
1759 | fdisc->u.fxiocb.flags = | 1760 | fdisc->u.fxiocb.flags = |
1760 | SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; | 1761 | SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; |
1761 | fdisc->u.fxiocb.rsp_len = QLAFX00_PORT_DATA_INFO; | 1762 | fdisc->u.fxiocb.rsp_len = QLAFX00_PORT_DATA_INFO; |
1762 | fdisc->u.fxiocb.req_data = fcport->port_id; | 1763 | fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->port_id); |
1763 | break; | 1764 | break; |
1764 | case FXDISC_GET_TGT_NODE_INFO: | 1765 | case FXDISC_GET_TGT_NODE_INFO: |
1765 | fdisc->u.fxiocb.flags = | 1766 | fdisc->u.fxiocb.flags = |
1766 | SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; | 1767 | SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; |
1767 | fdisc->u.fxiocb.rsp_len = QLAFX00_TGT_NODE_INFO; | 1768 | fdisc->u.fxiocb.rsp_len = QLAFX00_TGT_NODE_INFO; |
1768 | fdisc->u.fxiocb.req_data = fcport->tgt_id; | 1769 | fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->tgt_id); |
1769 | break; | 1770 | break; |
1770 | case FXDISC_GET_TGT_NODE_LIST: | 1771 | case FXDISC_GET_TGT_NODE_LIST: |
1771 | fdisc->u.fxiocb.flags = | 1772 | fdisc->u.fxiocb.flags = |
@@ -1851,7 +1852,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type) | |||
1851 | sp->name = "fxdisc"; | 1852 | sp->name = "fxdisc"; |
1852 | qla2x00_init_timer(sp, FXDISC_TIMEOUT); | 1853 | qla2x00_init_timer(sp, FXDISC_TIMEOUT); |
1853 | fdisc->timeout = qla2x00_fxdisc_iocb_timeout; | 1854 | fdisc->timeout = qla2x00_fxdisc_iocb_timeout; |
1854 | fdisc->u.fxiocb.req_func_type = fx_type; | 1855 | fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type); |
1855 | sp->done = qla2x00_fxdisc_sp_done; | 1856 | sp->done = qla2x00_fxdisc_sp_done; |
1856 | 1857 | ||
1857 | rval = qla2x00_start_sp(sp); | 1858 | rval = qla2x00_start_sp(sp); |
@@ -1904,7 +1905,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type) | |||
1904 | (uint8_t *)pinfo, 16); | 1905 | (uint8_t *)pinfo, 16); |
1905 | memcpy(vha->hw->gid_list, pinfo, QLAFX00_TGT_NODE_LIST_SIZE); | 1906 | memcpy(vha->hw->gid_list, pinfo, QLAFX00_TGT_NODE_LIST_SIZE); |
1906 | } | 1907 | } |
1907 | rval = fdisc->u.fxiocb.result; | 1908 | rval = le32_to_cpu(fdisc->u.fxiocb.result); |
1908 | 1909 | ||
1909 | done_unmap_dma: | 1910 | done_unmap_dma: |
1910 | if (fdisc->u.fxiocb.rsp_addr) | 1911 | if (fdisc->u.fxiocb.rsp_addr) |
@@ -1927,7 +1928,7 @@ qlafx00_abort_iocb_timeout(void *data) | |||
1927 | srb_t *sp = (srb_t *)data; | 1928 | srb_t *sp = (srb_t *)data; |
1928 | struct srb_iocb *abt = &sp->u.iocb_cmd; | 1929 | struct srb_iocb *abt = &sp->u.iocb_cmd; |
1929 | 1930 | ||
1930 | abt->u.abt.comp_status = CS_TIMEOUT; | 1931 | abt->u.abt.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT); |
1931 | complete(&abt->u.abt.comp); | 1932 | complete(&abt->u.abt.comp); |
1932 | } | 1933 | } |
1933 | 1934 | ||
@@ -2169,14 +2170,14 @@ qlafx00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len, | |||
2169 | static void | 2170 | static void |
2170 | qlafx00_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, | 2171 | qlafx00_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, |
2171 | struct tsk_mgmt_entry_fx00 *pkt, srb_t *sp, | 2172 | struct tsk_mgmt_entry_fx00 *pkt, srb_t *sp, |
2172 | uint16_t sstatus, uint16_t cpstatus) | 2173 | __le16 sstatus, __le16 cpstatus) |
2173 | { | 2174 | { |
2174 | struct srb_iocb *tmf; | 2175 | struct srb_iocb *tmf; |
2175 | 2176 | ||
2176 | tmf = &sp->u.iocb_cmd; | 2177 | tmf = &sp->u.iocb_cmd; |
2177 | if (cpstatus != CS_COMPLETE || | 2178 | if (cpstatus != cpu_to_le16((uint16_t)CS_COMPLETE) || |
2178 | (sstatus & SS_RESPONSE_INFO_LEN_VALID)) | 2179 | (sstatus & cpu_to_le16((uint16_t)SS_RESPONSE_INFO_LEN_VALID))) |
2179 | cpstatus = CS_INCOMPLETE; | 2180 | cpstatus = cpu_to_le16((uint16_t)CS_INCOMPLETE); |
2180 | tmf->u.tmf.comp_status = cpstatus; | 2181 | tmf->u.tmf.comp_status = cpstatus; |
2181 | sp->done(vha, sp, 0); | 2182 | sp->done(vha, sp, 0); |
2182 | } | 2183 | } |
@@ -2194,7 +2195,7 @@ qlafx00_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, | |||
2194 | return; | 2195 | return; |
2195 | 2196 | ||
2196 | abt = &sp->u.iocb_cmd; | 2197 | abt = &sp->u.iocb_cmd; |
2197 | abt->u.abt.comp_status = le32_to_cpu(pkt->tgt_id_sts); | 2198 | abt->u.abt.comp_status = pkt->tgt_id_sts; |
2198 | sp->done(vha, sp, 0); | 2199 | sp->done(vha, sp, 0); |
2199 | } | 2200 | } |
2200 | 2201 | ||
@@ -2216,12 +2217,12 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req, | |||
2216 | 2217 | ||
2217 | if (sp->type == SRB_FXIOCB_DCMD) { | 2218 | if (sp->type == SRB_FXIOCB_DCMD) { |
2218 | iocb_job = &sp->u.iocb_cmd; | 2219 | iocb_job = &sp->u.iocb_cmd; |
2219 | iocb_job->u.fxiocb.seq_number = le32_to_cpu(pkt->seq_no); | 2220 | iocb_job->u.fxiocb.seq_number = pkt->seq_no; |
2220 | iocb_job->u.fxiocb.fw_flags = le32_to_cpu(pkt->fw_iotcl_flags); | 2221 | iocb_job->u.fxiocb.fw_flags = pkt->fw_iotcl_flags; |
2221 | iocb_job->u.fxiocb.result = le32_to_cpu(pkt->status); | 2222 | iocb_job->u.fxiocb.result = pkt->status; |
2222 | if (iocb_job->u.fxiocb.flags & SRB_FXDISC_RSP_DWRD_VALID) | 2223 | if (iocb_job->u.fxiocb.flags & SRB_FXDISC_RSP_DWRD_VALID) |
2223 | iocb_job->u.fxiocb.req_data = | 2224 | iocb_job->u.fxiocb.req_data = |
2224 | le32_to_cpu(pkt->dataword_r); | 2225 | pkt->dataword_r; |
2225 | } else { | 2226 | } else { |
2226 | bsg_job = sp->u.bsg_job; | 2227 | bsg_job = sp->u.bsg_job; |
2227 | 2228 | ||
@@ -2275,10 +2276,10 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2275 | fc_port_t *fcport; | 2276 | fc_port_t *fcport; |
2276 | struct scsi_cmnd *cp; | 2277 | struct scsi_cmnd *cp; |
2277 | struct sts_entry_fx00 *sts; | 2278 | struct sts_entry_fx00 *sts; |
2278 | uint16_t comp_status; | 2279 | __le16 comp_status; |
2279 | uint16_t scsi_status; | 2280 | __le16 scsi_status; |
2280 | uint16_t ox_id; | 2281 | uint16_t ox_id; |
2281 | uint8_t lscsi_status; | 2282 | __le16 lscsi_status; |
2282 | int32_t resid; | 2283 | int32_t resid; |
2283 | uint32_t sense_len, par_sense_len, rsp_info_len, resid_len, | 2284 | uint32_t sense_len, par_sense_len, rsp_info_len, resid_len, |
2284 | fw_resid_len; | 2285 | fw_resid_len; |
@@ -2292,8 +2293,8 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2292 | 2293 | ||
2293 | sts = (struct sts_entry_fx00 *) pkt; | 2294 | sts = (struct sts_entry_fx00 *) pkt; |
2294 | 2295 | ||
2295 | comp_status = le16_to_cpu(sts->comp_status); | 2296 | comp_status = sts->comp_status; |
2296 | scsi_status = le16_to_cpu(sts->scsi_status) & SS_MASK; | 2297 | scsi_status = sts->scsi_status & cpu_to_le16((uint16_t)SS_MASK); |
2297 | hindex = sts->handle; | 2298 | hindex = sts->handle; |
2298 | handle = LSW(hindex); | 2299 | handle = LSW(hindex); |
2299 | 2300 | ||
@@ -2339,38 +2340,40 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2339 | return; | 2340 | return; |
2340 | } | 2341 | } |
2341 | 2342 | ||
2342 | lscsi_status = scsi_status & STATUS_MASK; | 2343 | lscsi_status = scsi_status & cpu_to_le16((uint16_t)STATUS_MASK); |
2343 | 2344 | ||
2344 | fcport = sp->fcport; | 2345 | fcport = sp->fcport; |
2345 | 2346 | ||
2346 | ox_id = 0; | 2347 | ox_id = 0; |
2347 | sense_len = par_sense_len = rsp_info_len = resid_len = | 2348 | sense_len = par_sense_len = rsp_info_len = resid_len = |
2348 | fw_resid_len = 0; | 2349 | fw_resid_len = 0; |
2349 | if (scsi_status & SS_SENSE_LEN_VALID) | 2350 | if (scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID)) |
2350 | sense_len = le32_to_cpu(sts->sense_len); | 2351 | sense_len = sts->sense_len; |
2351 | if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) | 2352 | if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER |
2353 | | (uint16_t)SS_RESIDUAL_OVER))) | ||
2352 | resid_len = le32_to_cpu(sts->residual_len); | 2354 | resid_len = le32_to_cpu(sts->residual_len); |
2353 | if (comp_status == CS_DATA_UNDERRUN) | 2355 | if (comp_status == cpu_to_le16((uint16_t)CS_DATA_UNDERRUN)) |
2354 | fw_resid_len = le32_to_cpu(sts->residual_len); | 2356 | fw_resid_len = le32_to_cpu(sts->residual_len); |
2355 | rsp_info = sense_data = sts->data; | 2357 | rsp_info = sense_data = sts->data; |
2356 | par_sense_len = sizeof(sts->data); | 2358 | par_sense_len = sizeof(sts->data); |
2357 | 2359 | ||
2358 | /* Check for overrun. */ | 2360 | /* Check for overrun. */ |
2359 | if (comp_status == CS_COMPLETE && | 2361 | if (comp_status == CS_COMPLETE && |
2360 | scsi_status & SS_RESIDUAL_OVER) | 2362 | scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_OVER)) |
2361 | comp_status = CS_DATA_OVERRUN; | 2363 | comp_status = cpu_to_le16((uint16_t)CS_DATA_OVERRUN); |
2362 | 2364 | ||
2363 | /* | 2365 | /* |
2364 | * Based on Host and scsi status generate status code for Linux | 2366 | * Based on Host and scsi status generate status code for Linux |
2365 | */ | 2367 | */ |
2366 | switch (comp_status) { | 2368 | switch (le16_to_cpu(comp_status)) { |
2367 | case CS_COMPLETE: | 2369 | case CS_COMPLETE: |
2368 | case CS_QUEUE_FULL: | 2370 | case CS_QUEUE_FULL: |
2369 | if (scsi_status == 0) { | 2371 | if (scsi_status == 0) { |
2370 | res = DID_OK << 16; | 2372 | res = DID_OK << 16; |
2371 | break; | 2373 | break; |
2372 | } | 2374 | } |
2373 | if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) { | 2375 | if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER |
2376 | | (uint16_t)SS_RESIDUAL_OVER))) { | ||
2374 | resid = resid_len; | 2377 | resid = resid_len; |
2375 | scsi_set_resid(cp, resid); | 2378 | scsi_set_resid(cp, resid); |
2376 | 2379 | ||
@@ -2386,19 +2389,20 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2386 | break; | 2389 | break; |
2387 | } | 2390 | } |
2388 | } | 2391 | } |
2389 | res = DID_OK << 16 | lscsi_status; | 2392 | res = DID_OK << 16 | le16_to_cpu(lscsi_status); |
2390 | 2393 | ||
2391 | if (lscsi_status == SAM_STAT_TASK_SET_FULL) { | 2394 | if (lscsi_status == |
2395 | cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) { | ||
2392 | ql_dbg(ql_dbg_io, fcport->vha, 0x3051, | 2396 | ql_dbg(ql_dbg_io, fcport->vha, 0x3051, |
2393 | "QUEUE FULL detected.\n"); | 2397 | "QUEUE FULL detected.\n"); |
2394 | break; | 2398 | break; |
2395 | } | 2399 | } |
2396 | logit = 0; | 2400 | logit = 0; |
2397 | if (lscsi_status != SS_CHECK_CONDITION) | 2401 | if (lscsi_status != cpu_to_le16((uint16_t)SS_CHECK_CONDITION)) |
2398 | break; | 2402 | break; |
2399 | 2403 | ||
2400 | memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2404 | memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2401 | if (!(scsi_status & SS_SENSE_LEN_VALID)) | 2405 | if (!(scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID))) |
2402 | break; | 2406 | break; |
2403 | 2407 | ||
2404 | qlafx00_handle_sense(sp, sense_data, par_sense_len, sense_len, | 2408 | qlafx00_handle_sense(sp, sense_data, par_sense_len, sense_len, |
@@ -2412,7 +2416,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2412 | else | 2416 | else |
2413 | resid = resid_len; | 2417 | resid = resid_len; |
2414 | scsi_set_resid(cp, resid); | 2418 | scsi_set_resid(cp, resid); |
2415 | if (scsi_status & SS_RESIDUAL_UNDER) { | 2419 | if (scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_UNDER)) { |
2416 | if ((IS_FWI2_CAPABLE(ha) || IS_QLAFX00(ha)) | 2420 | if ((IS_FWI2_CAPABLE(ha) || IS_QLAFX00(ha)) |
2417 | && fw_resid_len != resid_len) { | 2421 | && fw_resid_len != resid_len) { |
2418 | ql_dbg(ql_dbg_io, fcport->vha, 0x3052, | 2422 | ql_dbg(ql_dbg_io, fcport->vha, 0x3052, |
@@ -2420,7 +2424,8 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2420 | "(0x%x of 0x%x bytes).\n", | 2424 | "(0x%x of 0x%x bytes).\n", |
2421 | resid, scsi_bufflen(cp)); | 2425 | resid, scsi_bufflen(cp)); |
2422 | 2426 | ||
2423 | res = DID_ERROR << 16 | lscsi_status; | 2427 | res = DID_ERROR << 16 | |
2428 | le16_to_cpu(lscsi_status); | ||
2424 | goto check_scsi_status; | 2429 | goto check_scsi_status; |
2425 | } | 2430 | } |
2426 | 2431 | ||
@@ -2436,8 +2441,9 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2436 | res = DID_ERROR << 16; | 2441 | res = DID_ERROR << 16; |
2437 | break; | 2442 | break; |
2438 | } | 2443 | } |
2439 | } else if (lscsi_status != SAM_STAT_TASK_SET_FULL && | 2444 | } else if (lscsi_status != |
2440 | lscsi_status != SAM_STAT_BUSY) { | 2445 | cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL) && |
2446 | lscsi_status != cpu_to_le16((uint16_t)SAM_STAT_BUSY)) { | ||
2441 | /* | 2447 | /* |
2442 | * scsi status of task set and busy are considered | 2448 | * scsi status of task set and busy are considered |
2443 | * to be task not completed. | 2449 | * to be task not completed. |
@@ -2448,7 +2454,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2448 | "of 0x%x bytes).\n", resid, | 2454 | "of 0x%x bytes).\n", resid, |
2449 | scsi_bufflen(cp)); | 2455 | scsi_bufflen(cp)); |
2450 | 2456 | ||
2451 | res = DID_ERROR << 16 | lscsi_status; | 2457 | res = DID_ERROR << 16 | le16_to_cpu(lscsi_status); |
2452 | goto check_scsi_status; | 2458 | goto check_scsi_status; |
2453 | } else { | 2459 | } else { |
2454 | ql_dbg(ql_dbg_io, fcport->vha, 0x3055, | 2460 | ql_dbg(ql_dbg_io, fcport->vha, 0x3055, |
@@ -2456,7 +2462,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2456 | scsi_status, lscsi_status); | 2462 | scsi_status, lscsi_status); |
2457 | } | 2463 | } |
2458 | 2464 | ||
2459 | res = DID_OK << 16 | lscsi_status; | 2465 | res = DID_OK << 16 | le16_to_cpu(lscsi_status); |
2460 | logit = 0; | 2466 | logit = 0; |
2461 | 2467 | ||
2462 | check_scsi_status: | 2468 | check_scsi_status: |
@@ -2465,17 +2471,20 @@ check_scsi_status: | |||
2465 | * Status. | 2471 | * Status. |
2466 | */ | 2472 | */ |
2467 | if (lscsi_status != 0) { | 2473 | if (lscsi_status != 0) { |
2468 | if (lscsi_status == SAM_STAT_TASK_SET_FULL) { | 2474 | if (lscsi_status == |
2475 | cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) { | ||
2469 | ql_dbg(ql_dbg_io, fcport->vha, 0x3056, | 2476 | ql_dbg(ql_dbg_io, fcport->vha, 0x3056, |
2470 | "QUEUE FULL detected.\n"); | 2477 | "QUEUE FULL detected.\n"); |
2471 | logit = 1; | 2478 | logit = 1; |
2472 | break; | 2479 | break; |
2473 | } | 2480 | } |
2474 | if (lscsi_status != SS_CHECK_CONDITION) | 2481 | if (lscsi_status != |
2482 | cpu_to_le16((uint16_t)SS_CHECK_CONDITION)) | ||
2475 | break; | 2483 | break; |
2476 | 2484 | ||
2477 | memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2485 | memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2478 | if (!(scsi_status & SS_SENSE_LEN_VALID)) | 2486 | if (!(scsi_status & |
2487 | cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID))) | ||
2479 | break; | 2488 | break; |
2480 | 2489 | ||
2481 | qlafx00_handle_sense(sp, sense_data, par_sense_len, | 2490 | qlafx00_handle_sense(sp, sense_data, par_sense_len, |
@@ -2629,7 +2638,7 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha, | |||
2629 | uint32_t handle, hindex, handle_count, i; | 2638 | uint32_t handle, hindex, handle_count, i; |
2630 | uint16_t que; | 2639 | uint16_t que; |
2631 | struct req_que *req; | 2640 | struct req_que *req; |
2632 | uint32_t *handle_ptr; | 2641 | __le32 *handle_ptr; |
2633 | 2642 | ||
2634 | stsmfx = (struct multi_sts_entry_fx00 *) pkt; | 2643 | stsmfx = (struct multi_sts_entry_fx00 *) pkt; |
2635 | 2644 | ||
@@ -2643,7 +2652,7 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha, | |||
2643 | return; | 2652 | return; |
2644 | } | 2653 | } |
2645 | 2654 | ||
2646 | handle_ptr = (uint32_t *) &stsmfx->handles[0]; | 2655 | handle_ptr = &stsmfx->handles[0]; |
2647 | 2656 | ||
2648 | for (i = 0; i < handle_count; i++) { | 2657 | for (i = 0; i < handle_count; i++) { |
2649 | hindex = le32_to_cpu(*handle_ptr); | 2658 | hindex = le32_to_cpu(*handle_ptr); |
@@ -2714,10 +2723,11 @@ qlafx00_process_response_queue(struct scsi_qla_host *vha, | |||
2714 | if (!vha->flags.online) | 2723 | if (!vha->flags.online) |
2715 | return; | 2724 | return; |
2716 | 2725 | ||
2717 | while (RD_REG_DWORD(&(rsp->ring_ptr->signature)) != | 2726 | while (RD_REG_DWORD((void __iomem *)&(rsp->ring_ptr->signature)) != |
2718 | RESPONSE_PROCESSED) { | 2727 | RESPONSE_PROCESSED) { |
2719 | lptr = rsp->ring_ptr; | 2728 | lptr = rsp->ring_ptr; |
2720 | memcpy_fromio(rsp->rsp_pkt, lptr, sizeof(rsp->rsp_pkt)); | 2729 | memcpy_fromio(rsp->rsp_pkt, (void __iomem *)lptr, |
2730 | sizeof(rsp->rsp_pkt)); | ||
2721 | pkt = (struct sts_entry_fx00 *)rsp->rsp_pkt; | 2731 | pkt = (struct sts_entry_fx00 *)rsp->rsp_pkt; |
2722 | 2732 | ||
2723 | rsp->ring_index++; | 2733 | rsp->ring_index++; |
@@ -2768,7 +2778,8 @@ qlafx00_process_response_queue(struct scsi_qla_host *vha, | |||
2768 | break; | 2778 | break; |
2769 | } | 2779 | } |
2770 | next_iter: | 2780 | next_iter: |
2771 | WRT_REG_DWORD(&lptr->signature, RESPONSE_PROCESSED); | 2781 | WRT_REG_DWORD((void __iomem *)&lptr->signature, |
2782 | RESPONSE_PROCESSED); | ||
2772 | wmb(); | 2783 | wmb(); |
2773 | } | 2784 | } |
2774 | 2785 | ||
@@ -2958,8 +2969,7 @@ qlafx00_prep_cont_type1_iocb(struct req_que *req, | |||
2958 | cont_pkt = (cont_a64_entry_t *)req->ring_ptr; | 2969 | cont_pkt = (cont_a64_entry_t *)req->ring_ptr; |
2959 | 2970 | ||
2960 | /* Load packet defaults. */ | 2971 | /* Load packet defaults. */ |
2961 | *((uint32_t *)(&lcont_pkt->entry_type)) = | 2972 | lcont_pkt->entry_type = CONTINUE_A64_TYPE_FX00; |
2962 | __constant_cpu_to_le32(CONTINUE_A64_TYPE_FX00); | ||
2963 | 2973 | ||
2964 | return cont_pkt; | 2974 | return cont_pkt; |
2965 | } | 2975 | } |
@@ -2969,7 +2979,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt, | |||
2969 | uint16_t tot_dsds, struct cmd_type_7_fx00 *lcmd_pkt) | 2979 | uint16_t tot_dsds, struct cmd_type_7_fx00 *lcmd_pkt) |
2970 | { | 2980 | { |
2971 | uint16_t avail_dsds; | 2981 | uint16_t avail_dsds; |
2972 | uint32_t *cur_dsd; | 2982 | __le32 *cur_dsd; |
2973 | scsi_qla_host_t *vha; | 2983 | scsi_qla_host_t *vha; |
2974 | struct scsi_cmnd *cmd; | 2984 | struct scsi_cmnd *cmd; |
2975 | struct scatterlist *sg; | 2985 | struct scatterlist *sg; |
@@ -2986,8 +2996,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt, | |||
2986 | cont_pkt = NULL; | 2996 | cont_pkt = NULL; |
2987 | 2997 | ||
2988 | /* Update entry type to indicate Command Type 3 IOCB */ | 2998 | /* Update entry type to indicate Command Type 3 IOCB */ |
2989 | *((uint32_t *)(&lcmd_pkt->entry_type)) = | 2999 | lcmd_pkt->entry_type = FX00_COMMAND_TYPE_7; |
2990 | __constant_cpu_to_le32(FX00_COMMAND_TYPE_7); | ||
2991 | 3000 | ||
2992 | /* No data transfer */ | 3001 | /* No data transfer */ |
2993 | if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { | 3002 | if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { |
@@ -3006,7 +3015,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt, | |||
3006 | 3015 | ||
3007 | /* One DSD is available in the Command Type 3 IOCB */ | 3016 | /* One DSD is available in the Command Type 3 IOCB */ |
3008 | avail_dsds = 1; | 3017 | avail_dsds = 1; |
3009 | cur_dsd = (uint32_t *)&lcmd_pkt->dseg_0_address; | 3018 | cur_dsd = (__le32 *)&lcmd_pkt->dseg_0_address; |
3010 | 3019 | ||
3011 | /* Load data segments */ | 3020 | /* Load data segments */ |
3012 | scsi_for_each_sg(cmd, sg, tot_dsds, i) { | 3021 | scsi_for_each_sg(cmd, sg, tot_dsds, i) { |
@@ -3021,7 +3030,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt, | |||
3021 | memset(&lcont_pkt, 0, REQUEST_ENTRY_SIZE); | 3030 | memset(&lcont_pkt, 0, REQUEST_ENTRY_SIZE); |
3022 | cont_pkt = | 3031 | cont_pkt = |
3023 | qlafx00_prep_cont_type1_iocb(req, &lcont_pkt); | 3032 | qlafx00_prep_cont_type1_iocb(req, &lcont_pkt); |
3024 | cur_dsd = (uint32_t *)lcont_pkt.dseg_0_address; | 3033 | cur_dsd = (__le32 *)lcont_pkt.dseg_0_address; |
3025 | avail_dsds = 5; | 3034 | avail_dsds = 5; |
3026 | cont = 1; | 3035 | cont = 1; |
3027 | } | 3036 | } |
@@ -3224,13 +3233,13 @@ qlafx00_tm_iocb(srb_t *sp, struct tsk_mgmt_entry_fx00 *ptm_iocb) | |||
3224 | tm_iocb.timeout = cpu_to_le16(qla2x00_get_async_timeout(vha) + 2); | 3233 | tm_iocb.timeout = cpu_to_le16(qla2x00_get_async_timeout(vha) + 2); |
3225 | tm_iocb.tgt_id = cpu_to_le16(sp->fcport->tgt_id); | 3234 | tm_iocb.tgt_id = cpu_to_le16(sp->fcport->tgt_id); |
3226 | tm_iocb.control_flags = cpu_to_le32(fxio->u.tmf.flags); | 3235 | tm_iocb.control_flags = cpu_to_le32(fxio->u.tmf.flags); |
3227 | if (tm_iocb.control_flags == TCF_LUN_RESET) { | 3236 | if (tm_iocb.control_flags == cpu_to_le32((uint32_t)TCF_LUN_RESET)) { |
3228 | int_to_scsilun(fxio->u.tmf.lun, &llun); | 3237 | int_to_scsilun(fxio->u.tmf.lun, &llun); |
3229 | host_to_adap((uint8_t *)&llun, (uint8_t *)&tm_iocb.lun, | 3238 | host_to_adap((uint8_t *)&llun, (uint8_t *)&tm_iocb.lun, |
3230 | sizeof(struct scsi_lun)); | 3239 | sizeof(struct scsi_lun)); |
3231 | } | 3240 | } |
3232 | 3241 | ||
3233 | memcpy((void __iomem *)ptm_iocb, &tm_iocb, | 3242 | memcpy((void *)ptm_iocb, &tm_iocb, |
3234 | sizeof(struct tsk_mgmt_entry_fx00)); | 3243 | sizeof(struct tsk_mgmt_entry_fx00)); |
3235 | wmb(); | 3244 | wmb(); |
3236 | } | 3245 | } |
@@ -3252,7 +3261,7 @@ qlafx00_abort_iocb(srb_t *sp, struct abort_iocb_entry_fx00 *pabt_iocb) | |||
3252 | abt_iocb.tgt_id_sts = cpu_to_le16(sp->fcport->tgt_id); | 3261 | abt_iocb.tgt_id_sts = cpu_to_le16(sp->fcport->tgt_id); |
3253 | abt_iocb.req_que_no = cpu_to_le16(req->id); | 3262 | abt_iocb.req_que_no = cpu_to_le16(req->id); |
3254 | 3263 | ||
3255 | memcpy((void __iomem *)pabt_iocb, &abt_iocb, | 3264 | memcpy((void *)pabt_iocb, &abt_iocb, |
3256 | sizeof(struct abort_iocb_entry_fx00)); | 3265 | sizeof(struct abort_iocb_entry_fx00)); |
3257 | wmb(); | 3266 | wmb(); |
3258 | } | 3267 | } |
@@ -3273,13 +3282,12 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3273 | 3282 | ||
3274 | if (sp->type == SRB_FXIOCB_DCMD) { | 3283 | if (sp->type == SRB_FXIOCB_DCMD) { |
3275 | fx_iocb.func_num = | 3284 | fx_iocb.func_num = |
3276 | cpu_to_le16(sp->u.iocb_cmd.u.fxiocb.req_func_type); | 3285 | sp->u.iocb_cmd.u.fxiocb.req_func_type; |
3277 | fx_iocb.adapid = cpu_to_le32(fxio->u.fxiocb.adapter_id); | 3286 | fx_iocb.adapid = fxio->u.fxiocb.adapter_id; |
3278 | fx_iocb.adapid_hi = cpu_to_le32(fxio->u.fxiocb.adapter_id_hi); | 3287 | fx_iocb.adapid_hi = fxio->u.fxiocb.adapter_id_hi; |
3279 | fx_iocb.reserved_0 = cpu_to_le32(fxio->u.fxiocb.reserved_0); | 3288 | fx_iocb.reserved_0 = fxio->u.fxiocb.reserved_0; |
3280 | fx_iocb.reserved_1 = cpu_to_le32(fxio->u.fxiocb.reserved_1); | 3289 | fx_iocb.reserved_1 = fxio->u.fxiocb.reserved_1; |
3281 | fx_iocb.dataword_extra = | 3290 | fx_iocb.dataword_extra = fxio->u.fxiocb.req_data_extra; |
3282 | cpu_to_le32(fxio->u.fxiocb.req_data_extra); | ||
3283 | 3291 | ||
3284 | if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DMA_VALID) { | 3292 | if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DMA_VALID) { |
3285 | fx_iocb.req_dsdcnt = cpu_to_le16(1); | 3293 | fx_iocb.req_dsdcnt = cpu_to_le16(1); |
@@ -3306,8 +3314,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3306 | } | 3314 | } |
3307 | 3315 | ||
3308 | if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DWRD_VALID) { | 3316 | if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DWRD_VALID) { |
3309 | fx_iocb.dataword = | 3317 | fx_iocb.dataword = fxio->u.fxiocb.req_data; |
3310 | cpu_to_le32(fxio->u.fxiocb.req_data); | ||
3311 | } | 3318 | } |
3312 | fx_iocb.flags = fxio->u.fxiocb.flags; | 3319 | fx_iocb.flags = fxio->u.fxiocb.flags; |
3313 | } else { | 3320 | } else { |
@@ -3323,21 +3330,21 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3323 | fx_iocb.reserved_1 = piocb_rqst->reserved_1; | 3330 | fx_iocb.reserved_1 = piocb_rqst->reserved_1; |
3324 | fx_iocb.dataword_extra = piocb_rqst->dataword_extra; | 3331 | fx_iocb.dataword_extra = piocb_rqst->dataword_extra; |
3325 | fx_iocb.dataword = piocb_rqst->dataword; | 3332 | fx_iocb.dataword = piocb_rqst->dataword; |
3326 | fx_iocb.req_xfrcnt = cpu_to_le16(piocb_rqst->req_len); | 3333 | fx_iocb.req_xfrcnt = piocb_rqst->req_len; |
3327 | fx_iocb.rsp_xfrcnt = cpu_to_le16(piocb_rqst->rsp_len); | 3334 | fx_iocb.rsp_xfrcnt = piocb_rqst->rsp_len; |
3328 | 3335 | ||
3329 | if (piocb_rqst->flags & SRB_FXDISC_REQ_DMA_VALID) { | 3336 | if (piocb_rqst->flags & SRB_FXDISC_REQ_DMA_VALID) { |
3330 | int avail_dsds, tot_dsds; | 3337 | int avail_dsds, tot_dsds; |
3331 | cont_a64_entry_t lcont_pkt; | 3338 | cont_a64_entry_t lcont_pkt; |
3332 | cont_a64_entry_t *cont_pkt = NULL; | 3339 | cont_a64_entry_t *cont_pkt = NULL; |
3333 | uint32_t *cur_dsd; | 3340 | __le32 *cur_dsd; |
3334 | int index = 0, cont = 0; | 3341 | int index = 0, cont = 0; |
3335 | 3342 | ||
3336 | fx_iocb.req_dsdcnt = | 3343 | fx_iocb.req_dsdcnt = |
3337 | cpu_to_le16(bsg_job->request_payload.sg_cnt); | 3344 | cpu_to_le16(bsg_job->request_payload.sg_cnt); |
3338 | tot_dsds = | 3345 | tot_dsds = |
3339 | cpu_to_le32(bsg_job->request_payload.sg_cnt); | 3346 | bsg_job->request_payload.sg_cnt; |
3340 | cur_dsd = (uint32_t *)&fx_iocb.dseg_rq_address[0]; | 3347 | cur_dsd = (__le32 *)&fx_iocb.dseg_rq_address[0]; |
3341 | avail_dsds = 1; | 3348 | avail_dsds = 1; |
3342 | for_each_sg(bsg_job->request_payload.sg_list, sg, | 3349 | for_each_sg(bsg_job->request_payload.sg_list, sg, |
3343 | tot_dsds, index) { | 3350 | tot_dsds, index) { |
@@ -3355,7 +3362,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3355 | qlafx00_prep_cont_type1_iocb( | 3362 | qlafx00_prep_cont_type1_iocb( |
3356 | sp->fcport->vha->req, | 3363 | sp->fcport->vha->req, |
3357 | &lcont_pkt); | 3364 | &lcont_pkt); |
3358 | cur_dsd = (uint32_t *) | 3365 | cur_dsd = (__le32 *) |
3359 | lcont_pkt.dseg_0_address; | 3366 | lcont_pkt.dseg_0_address; |
3360 | avail_dsds = 5; | 3367 | avail_dsds = 5; |
3361 | cont = 1; | 3368 | cont = 1; |
@@ -3393,13 +3400,13 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3393 | int avail_dsds, tot_dsds; | 3400 | int avail_dsds, tot_dsds; |
3394 | cont_a64_entry_t lcont_pkt; | 3401 | cont_a64_entry_t lcont_pkt; |
3395 | cont_a64_entry_t *cont_pkt = NULL; | 3402 | cont_a64_entry_t *cont_pkt = NULL; |
3396 | uint32_t *cur_dsd; | 3403 | __le32 *cur_dsd; |
3397 | int index = 0, cont = 0; | 3404 | int index = 0, cont = 0; |
3398 | 3405 | ||
3399 | fx_iocb.rsp_dsdcnt = | 3406 | fx_iocb.rsp_dsdcnt = |
3400 | cpu_to_le16(bsg_job->reply_payload.sg_cnt); | 3407 | cpu_to_le16(bsg_job->reply_payload.sg_cnt); |
3401 | tot_dsds = cpu_to_le32(bsg_job->reply_payload.sg_cnt); | 3408 | tot_dsds = bsg_job->reply_payload.sg_cnt; |
3402 | cur_dsd = (uint32_t *)&fx_iocb.dseg_rsp_address[0]; | 3409 | cur_dsd = (__le32 *)&fx_iocb.dseg_rsp_address[0]; |
3403 | avail_dsds = 1; | 3410 | avail_dsds = 1; |
3404 | 3411 | ||
3405 | for_each_sg(bsg_job->reply_payload.sg_list, sg, | 3412 | for_each_sg(bsg_job->reply_payload.sg_list, sg, |
@@ -3418,7 +3425,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3418 | qlafx00_prep_cont_type1_iocb( | 3425 | qlafx00_prep_cont_type1_iocb( |
3419 | sp->fcport->vha->req, | 3426 | sp->fcport->vha->req, |
3420 | &lcont_pkt); | 3427 | &lcont_pkt); |
3421 | cur_dsd = (uint32_t *) | 3428 | cur_dsd = (__le32 *) |
3422 | lcont_pkt.dseg_0_address; | 3429 | lcont_pkt.dseg_0_address; |
3423 | avail_dsds = 5; | 3430 | avail_dsds = 5; |
3424 | cont = 1; | 3431 | cont = 1; |
@@ -3453,7 +3460,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3453 | } | 3460 | } |
3454 | 3461 | ||
3455 | if (piocb_rqst->flags & SRB_FXDISC_REQ_DWRD_VALID) | 3462 | if (piocb_rqst->flags & SRB_FXDISC_REQ_DWRD_VALID) |
3456 | fx_iocb.dataword = cpu_to_le32(piocb_rqst->dataword); | 3463 | fx_iocb.dataword = piocb_rqst->dataword; |
3457 | fx_iocb.flags = piocb_rqst->flags; | 3464 | fx_iocb.flags = piocb_rqst->flags; |
3458 | fx_iocb.entry_count = entry_cnt; | 3465 | fx_iocb.entry_count = entry_cnt; |
3459 | } | 3466 | } |
@@ -3462,7 +3469,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) | |||
3462 | sp->fcport->vha, 0x3047, | 3469 | sp->fcport->vha, 0x3047, |
3463 | (uint8_t *)&fx_iocb, sizeof(struct fxdisc_entry_fx00)); | 3470 | (uint8_t *)&fx_iocb, sizeof(struct fxdisc_entry_fx00)); |
3464 | 3471 | ||
3465 | memcpy((void __iomem *)pfxiocb, &fx_iocb, | 3472 | memcpy((void *)pfxiocb, &fx_iocb, |
3466 | sizeof(struct fxdisc_entry_fx00)); | 3473 | sizeof(struct fxdisc_entry_fx00)); |
3467 | wmb(); | 3474 | wmb(); |
3468 | } | 3475 | } |
diff --git a/drivers/scsi/qla2xxx/qla_mr.h b/drivers/scsi/qla2xxx/qla_mr.h index cc327dc2fd10..1a092af0e2c3 100644 --- a/drivers/scsi/qla2xxx/qla_mr.h +++ b/drivers/scsi/qla2xxx/qla_mr.h | |||
@@ -24,10 +24,10 @@ struct cmd_type_7_fx00 { | |||
24 | uint32_t handle; /* System handle. */ | 24 | uint32_t handle; /* System handle. */ |
25 | uint32_t handle_hi; | 25 | uint32_t handle_hi; |
26 | 26 | ||
27 | uint16_t tgt_idx; /* Target Idx. */ | 27 | __le16 tgt_idx; /* Target Idx. */ |
28 | uint16_t timeout; /* Command timeout. */ | 28 | uint16_t timeout; /* Command timeout. */ |
29 | 29 | ||
30 | uint16_t dseg_count; /* Data segment count. */ | 30 | __le16 dseg_count; /* Data segment count. */ |
31 | uint16_t scsi_rsp_dsd_len; | 31 | uint16_t scsi_rsp_dsd_len; |
32 | 32 | ||
33 | struct scsi_lun lun; /* LUN (LE). */ | 33 | struct scsi_lun lun; /* LUN (LE). */ |
@@ -41,7 +41,7 @@ struct cmd_type_7_fx00 { | |||
41 | uint8_t crn; | 41 | uint8_t crn; |
42 | 42 | ||
43 | uint8_t fcp_cdb[MAX_CMDSZ]; /* SCSI command words. */ | 43 | uint8_t fcp_cdb[MAX_CMDSZ]; /* SCSI command words. */ |
44 | uint32_t byte_count; /* Total byte count. */ | 44 | __le32 byte_count; /* Total byte count. */ |
45 | 45 | ||
46 | uint32_t dseg_0_address[2]; /* Data segment 0 address. */ | 46 | uint32_t dseg_0_address[2]; /* Data segment 0 address. */ |
47 | uint32_t dseg_0_len; /* Data segment 0 length. */ | 47 | uint32_t dseg_0_len; /* Data segment 0 length. */ |
@@ -81,16 +81,16 @@ struct sts_entry_fx00 { | |||
81 | uint32_t handle; /* System handle. */ | 81 | uint32_t handle; /* System handle. */ |
82 | uint32_t handle_hi; /* System handle. */ | 82 | uint32_t handle_hi; /* System handle. */ |
83 | 83 | ||
84 | uint16_t comp_status; /* Completion status. */ | 84 | __le16 comp_status; /* Completion status. */ |
85 | uint16_t reserved_0; /* OX_ID used by the firmware. */ | 85 | uint16_t reserved_0; /* OX_ID used by the firmware. */ |
86 | 86 | ||
87 | uint32_t residual_len; /* FW calc residual transfer length. */ | 87 | __le32 residual_len; /* FW calc residual transfer length. */ |
88 | 88 | ||
89 | uint16_t reserved_1; | 89 | uint16_t reserved_1; |
90 | uint16_t state_flags; /* State flags. */ | 90 | uint16_t state_flags; /* State flags. */ |
91 | 91 | ||
92 | uint16_t reserved_2; | 92 | uint16_t reserved_2; |
93 | uint16_t scsi_status; /* SCSI status. */ | 93 | __le16 scsi_status; /* SCSI status. */ |
94 | 94 | ||
95 | uint32_t sense_len; /* FCP SENSE length. */ | 95 | uint32_t sense_len; /* FCP SENSE length. */ |
96 | uint8_t data[32]; /* FCP response/sense information. */ | 96 | uint8_t data[32]; /* FCP response/sense information. */ |
@@ -106,7 +106,7 @@ struct multi_sts_entry_fx00 { | |||
106 | uint8_t handle_count; | 106 | uint8_t handle_count; |
107 | uint8_t entry_status; | 107 | uint8_t entry_status; |
108 | 108 | ||
109 | uint32_t handles[MAX_HANDLE_COUNT]; | 109 | __le32 handles[MAX_HANDLE_COUNT]; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | #define TSK_MGMT_IOCB_TYPE_FX00 0x05 | 112 | #define TSK_MGMT_IOCB_TYPE_FX00 0x05 |
@@ -116,21 +116,21 @@ struct tsk_mgmt_entry_fx00 { | |||
116 | uint8_t sys_define; | 116 | uint8_t sys_define; |
117 | uint8_t entry_status; /* Entry Status. */ | 117 | uint8_t entry_status; /* Entry Status. */ |
118 | 118 | ||
119 | uint32_t handle; /* System handle. */ | 119 | __le32 handle; /* System handle. */ |
120 | 120 | ||
121 | uint32_t handle_hi; /* System handle. */ | 121 | uint32_t handle_hi; /* System handle. */ |
122 | 122 | ||
123 | uint16_t tgt_id; /* Target Idx. */ | 123 | __le16 tgt_id; /* Target Idx. */ |
124 | 124 | ||
125 | uint16_t reserved_1; | 125 | uint16_t reserved_1; |
126 | 126 | ||
127 | uint16_t delay; /* Activity delay in seconds. */ | 127 | uint16_t delay; /* Activity delay in seconds. */ |
128 | 128 | ||
129 | uint16_t timeout; /* Command timeout. */ | 129 | __le16 timeout; /* Command timeout. */ |
130 | 130 | ||
131 | struct scsi_lun lun; /* LUN (LE). */ | 131 | struct scsi_lun lun; /* LUN (LE). */ |
132 | 132 | ||
133 | uint32_t control_flags; /* Control Flags. */ | 133 | __le32 control_flags; /* Control Flags. */ |
134 | 134 | ||
135 | uint8_t reserved_2[32]; | 135 | uint8_t reserved_2[32]; |
136 | }; | 136 | }; |
@@ -143,16 +143,16 @@ struct abort_iocb_entry_fx00 { | |||
143 | uint8_t sys_define; /* System defined. */ | 143 | uint8_t sys_define; /* System defined. */ |
144 | uint8_t entry_status; /* Entry Status. */ | 144 | uint8_t entry_status; /* Entry Status. */ |
145 | 145 | ||
146 | uint32_t handle; /* System handle. */ | 146 | __le32 handle; /* System handle. */ |
147 | uint32_t handle_hi; /* System handle. */ | 147 | __le32 handle_hi; /* System handle. */ |
148 | 148 | ||
149 | uint16_t tgt_id_sts; /* Completion status. */ | 149 | __le16 tgt_id_sts; /* Completion status. */ |
150 | uint16_t options; | 150 | __le16 options; |
151 | 151 | ||
152 | uint32_t abort_handle; /* System handle. */ | 152 | __le32 abort_handle; /* System handle. */ |
153 | uint32_t abort_handle_hi; /* System handle. */ | 153 | __le32 abort_handle_hi; /* System handle. */ |
154 | 154 | ||
155 | uint16_t req_que_no; | 155 | __le16 req_que_no; |
156 | uint8_t reserved_1[38]; | 156 | uint8_t reserved_1[38]; |
157 | }; | 157 | }; |
158 | 158 | ||
@@ -167,17 +167,17 @@ struct ioctl_iocb_entry_fx00 { | |||
167 | uint32_t reserved_0; /* System handle. */ | 167 | uint32_t reserved_0; /* System handle. */ |
168 | 168 | ||
169 | uint16_t comp_func_num; | 169 | uint16_t comp_func_num; |
170 | uint16_t fw_iotcl_flags; | 170 | __le16 fw_iotcl_flags; |
171 | 171 | ||
172 | uint32_t dataword_r; /* Data word returned */ | 172 | __le32 dataword_r; /* Data word returned */ |
173 | uint32_t adapid; /* Adapter ID */ | 173 | uint32_t adapid; /* Adapter ID */ |
174 | uint32_t adapid_hi; /* Adapter ID high */ | 174 | uint32_t adapid_hi; /* Adapter ID high */ |
175 | uint32_t reserved_1; | 175 | uint32_t reserved_1; |
176 | 176 | ||
177 | uint32_t seq_no; | 177 | __le32 seq_no; |
178 | uint8_t reserved_2[20]; | 178 | uint8_t reserved_2[20]; |
179 | uint32_t residuallen; | 179 | uint32_t residuallen; |
180 | uint32_t status; | 180 | __le32 status; |
181 | }; | 181 | }; |
182 | 182 | ||
183 | #define STATUS_CONT_TYPE_FX00 0x04 | 183 | #define STATUS_CONT_TYPE_FX00 0x04 |
@@ -189,26 +189,26 @@ struct fxdisc_entry_fx00 { | |||
189 | uint8_t sys_define; /* System Defined. */ | 189 | uint8_t sys_define; /* System Defined. */ |
190 | uint8_t entry_status; /* Entry Status. */ | 190 | uint8_t entry_status; /* Entry Status. */ |
191 | 191 | ||
192 | uint32_t handle; /* System handle. */ | 192 | __le32 handle; /* System handle. */ |
193 | uint32_t reserved_0; /* System handle. */ | 193 | __le32 reserved_0; /* System handle. */ |
194 | 194 | ||
195 | uint16_t func_num; | 195 | __le16 func_num; |
196 | uint16_t req_xfrcnt; | 196 | __le16 req_xfrcnt; |
197 | uint16_t req_dsdcnt; | 197 | __le16 req_dsdcnt; |
198 | uint16_t rsp_xfrcnt; | 198 | __le16 rsp_xfrcnt; |
199 | uint16_t rsp_dsdcnt; | 199 | __le16 rsp_dsdcnt; |
200 | uint8_t flags; | 200 | uint8_t flags; |
201 | uint8_t reserved_1; | 201 | uint8_t reserved_1; |
202 | 202 | ||
203 | uint32_t dseg_rq_address[2]; /* Data segment 0 address. */ | 203 | __le32 dseg_rq_address[2]; /* Data segment 0 address. */ |
204 | uint32_t dseg_rq_len; /* Data segment 0 length. */ | 204 | __le32 dseg_rq_len; /* Data segment 0 length. */ |
205 | uint32_t dseg_rsp_address[2]; /* Data segment 1 address. */ | 205 | __le32 dseg_rsp_address[2]; /* Data segment 1 address. */ |
206 | uint32_t dseg_rsp_len; /* Data segment 1 length. */ | 206 | __le32 dseg_rsp_len; /* Data segment 1 length. */ |
207 | 207 | ||
208 | uint32_t dataword; | 208 | __le32 dataword; |
209 | uint32_t adapid; | 209 | __le32 adapid; |
210 | uint32_t adapid_hi; | 210 | __le32 adapid_hi; |
211 | uint32_t dataword_extra; | 211 | __le32 dataword_extra; |
212 | }; | 212 | }; |
213 | 213 | ||
214 | struct qlafx00_tgt_node_info { | 214 | struct qlafx00_tgt_node_info { |
@@ -421,43 +421,43 @@ struct config_info_data { | |||
421 | WRT_REG_DWORD((ha)->cregbase + off, val) | 421 | WRT_REG_DWORD((ha)->cregbase + off, val) |
422 | 422 | ||
423 | struct qla_mt_iocb_rqst_fx00 { | 423 | struct qla_mt_iocb_rqst_fx00 { |
424 | uint32_t reserved_0; | 424 | __le32 reserved_0; |
425 | 425 | ||
426 | uint16_t func_type; | 426 | __le16 func_type; |
427 | uint8_t flags; | 427 | uint8_t flags; |
428 | uint8_t reserved_1; | 428 | uint8_t reserved_1; |
429 | 429 | ||
430 | uint32_t dataword; | 430 | __le32 dataword; |
431 | 431 | ||
432 | uint32_t adapid; | 432 | __le32 adapid; |
433 | uint32_t adapid_hi; | 433 | __le32 adapid_hi; |
434 | 434 | ||
435 | uint32_t dataword_extra; | 435 | __le32 dataword_extra; |
436 | 436 | ||
437 | uint32_t req_len; | 437 | __le32 req_len; |
438 | 438 | ||
439 | uint32_t rsp_len; | 439 | __le32 rsp_len; |
440 | }; | 440 | }; |
441 | 441 | ||
442 | struct qla_mt_iocb_rsp_fx00 { | 442 | struct qla_mt_iocb_rsp_fx00 { |
443 | uint32_t reserved_1; | 443 | uint32_t reserved_1; |
444 | 444 | ||
445 | uint16_t func_type; | 445 | uint16_t func_type; |
446 | uint16_t ioctl_flags; | 446 | __le16 ioctl_flags; |
447 | 447 | ||
448 | uint32_t ioctl_data; | 448 | __le32 ioctl_data; |
449 | 449 | ||
450 | uint32_t adapid; | 450 | uint32_t adapid; |
451 | uint32_t adapid_hi; | 451 | uint32_t adapid_hi; |
452 | 452 | ||
453 | uint32_t reserved_2; | 453 | uint32_t reserved_2; |
454 | uint32_t seq_number; | 454 | __le32 seq_number; |
455 | 455 | ||
456 | uint8_t reserved_3[20]; | 456 | uint8_t reserved_3[20]; |
457 | 457 | ||
458 | int32_t res_count; | 458 | int32_t res_count; |
459 | 459 | ||
460 | uint32_t status; | 460 | __le32 status; |
461 | }; | 461 | }; |
462 | 462 | ||
463 | 463 | ||