summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_library.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2007-07-02 20:08:20 +0000
committermjacob <mjacob@FreeBSD.org>2007-07-02 20:08:20 +0000
commitcef18a326e9f04844bc48259054878ca71852b75 (patch)
tree8d41ca883f700b6704bccd25e65c435609e54d44 /sys/dev/isp/isp_library.c
parenta400d04306bce1d90fa1fb76eb5ed9c3977a1c32 (diff)
downloadFreeBSD-src-cef18a326e9f04844bc48259054878ca71852b75.zip
FreeBSD-src-cef18a326e9f04844bc48259054878ca71852b75.tar.gz
Recover from some major omissions/problems with the 24XX port.
First, we were never correctly checking for a 24XX Status Type 0 response- that cased us to fall through to evaluate status for commands as if this were a 2100/2200/2300 Status Type 0 response. This is *close*, but not quite the same. This has been reported to be apparent with some wierd lun configuration problems with some arrays. It became glaringly apparent on sparc64 where none of the correct byte swap things were done. Fixing this omission then caused a whole universe shifting debug cycle of endian issues for the 2400. The manual for 24XX f/w turns out to be wrong about the endianness of a couple of entities. The lun and cdb fields for the type 7 request are *not* unconditionally big endian- they happen to be opposite of whatever the endian of the current machine type is. Same with the sense data for the 24XX type 0 response. While we're at it investigate and resolve some NVRAM endian issues. Approved by: re (ken) MFC after: 3 days
Diffstat (limited to 'sys/dev/isp/isp_library.c')
-rw-r--r--sys/dev/isp/isp_library.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c
index 2f628bf..1d6e6ee 100644
--- a/sys/dev/isp/isp_library.c
+++ b/sys/dev/isp/isp_library.c
@@ -593,7 +593,7 @@ isp_put_request_t7(ispsoftc_t *isp, ispreqt7_t *src, ispreqt7_t *dst)
a = (uint32_t *) src->req_lun;
b = (uint32_t *) dst->req_lun;
for (i = 0; i < (ASIZE(src->req_lun) >> 2); i++ ) {
- ISP_IOZPUT_32(isp, *a++, b++);
+ *b++ = ISP_SWAP32(isp, *a++);
}
ISP_IOXPUT_8(isp, src->req_alen_datadir, &dst->req_alen_datadir);
ISP_IOXPUT_8(isp, src->req_task_management, &dst->req_task_management);
@@ -601,8 +601,8 @@ isp_put_request_t7(ispsoftc_t *isp, ispreqt7_t *src, ispreqt7_t *dst)
ISP_IOXPUT_8(isp, src->req_crn, &dst->req_crn);
a = (uint32_t *) src->req_cdb;
b = (uint32_t *) dst->req_cdb;
- for (i = 0; i < (ASIZE(src->req_cdb) >> 2); i++ ) {
- ISP_IOZPUT_32(isp, *a++, b++);
+ for (i = 0; i < (ASIZE(src->req_cdb) >> 2); i++) {
+ *b++ = ISP_SWAP32(isp, *a++);
}
ISP_IOXPUT_32(isp, src->req_dl, &dst->req_dl);
ISP_IOXPUT_16(isp, src->req_tidlo, &dst->req_tidlo);
@@ -695,6 +695,8 @@ isp_get_24xx_response(ispsoftc_t *isp, isp24xx_statusreq_t *src,
isp24xx_statusreq_t *dst)
{
int i;
+ uint32_t *s, *d;
+
isp_get_hdr(isp, &src->req_header, &dst->req_header);
ISP_IOXGET_32(isp, &src->req_handle, dst->req_handle);
ISP_IOXGET_16(isp, &src->req_completion_status,
@@ -708,9 +710,10 @@ isp_get_24xx_response(ispsoftc_t *isp, isp24xx_statusreq_t *src,
ISP_IOXGET_32(isp, &src->req_fcp_residual, dst->req_fcp_residual);
ISP_IOXGET_32(isp, &src->req_sense_len, dst->req_sense_len);
ISP_IOXGET_32(isp, &src->req_response_len, dst->req_response_len);
- for (i = 0; i < 28; i++) {
- ISP_IOXGET_8(isp, &src->req_rsp_sense[i],
- dst->req_rsp_sense[i]);
+ s = (uint32_t *)src->req_rsp_sense;
+ d = (uint32_t *)dst->req_rsp_sense;
+ for (i = 0; i < (ASIZE(src->req_rsp_sense) >> 2); i++) {
+ d[i] = ISP_SWAP32(isp, s[i]);
}
}
@@ -723,14 +726,14 @@ isp_get_24xx_abrt(ispsoftc_t *isp, isp24xx_abrt_t *src, isp24xx_abrt_t *dst)
ISP_IOXGET_16(isp, &src->abrt_nphdl, dst->abrt_nphdl);
ISP_IOXGET_16(isp, &src->abrt_options, dst->abrt_options);
ISP_IOXGET_32(isp, &src->abrt_cmd_handle, dst->abrt_cmd_handle);
- for (i = 0; i < ASIZE(&src->abrt_reserved); i++) {
+ for (i = 0; i < ASIZE(src->abrt_reserved); i++) {
ISP_IOXGET_8(isp, &src->abrt_reserved[i],
dst->abrt_reserved[i]);
}
ISP_IOXGET_16(isp, &src->abrt_tidlo, dst->abrt_tidlo);
ISP_IOXGET_8(isp, &src->abrt_tidhi, dst->abrt_tidhi);
ISP_IOXGET_8(isp, &src->abrt_vpidx, dst->abrt_vpidx);
- for (i = 0; i < ASIZE(&src->abrt_reserved1); i++) {
+ for (i = 0; i < ASIZE(src->abrt_reserved1); i++) {
ISP_IOXGET_8(isp, &src->abrt_reserved1[i],
dst->abrt_reserved1[i]);
}
OpenPOWER on IntegriCloud