summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpr/mpr_user.c
diff options
context:
space:
mode:
authorslm <slm@FreeBSD.org>2016-05-09 16:21:14 +0000
committerslm <slm@FreeBSD.org>2016-05-09 16:21:14 +0000
commit24842df2a6a2c71b9fd8763a7e9feae95fa9cd80 (patch)
tree32f04067263969b0bdd6f4239474818e1a25114c /sys/dev/mpr/mpr_user.c
parent1f91a62e29c2cc858291a13fd9597225a819e5a8 (diff)
downloadFreeBSD-src-24842df2a6a2c71b9fd8763a7e9feae95fa9cd80.zip
FreeBSD-src-24842df2a6a2c71b9fd8763a7e9feae95fa9cd80.tar.gz
No log bit in IOCStatus and endian-safe changes.
Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6097
Diffstat (limited to 'sys/dev/mpr/mpr_user.c')
-rw-r--r--sys/dev/mpr/mpr_user.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c
index 8ae8713..db8de93 100644
--- a/sys/dev/mpr/mpr_user.c
+++ b/sys/dev/mpr/mpr_user.c
@@ -1255,12 +1255,14 @@ mpr_post_fw_diag_buffer(struct mpr_softc *sc,
* Process POST reply.
*/
reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply;
- if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) {
+ if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+ MPI2_IOCSTATUS_SUCCESS) {
status = MPR_DIAG_FAILURE;
mpr_dprint(sc, MPR_FAULT, "%s: post of FW Diag Buffer failed "
"with IOCStatus = 0x%x, IOCLogInfo = 0x%x and "
- "TransferLength = 0x%x\n", __func__, reply->IOCStatus,
- reply->IOCLogInfo, reply->TransferLength);
+ "TransferLength = 0x%x\n", __func__,
+ le16toh(reply->IOCStatus), le32toh(reply->IOCLogInfo),
+ le32toh(reply->TransferLength));
goto done;
}
@@ -1339,12 +1341,13 @@ mpr_release_fw_diag_buffer(struct mpr_softc *sc,
* Process RELEASE reply.
*/
reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply;
- if ((reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) ||
- pBuffer->owned_by_firmware) {
+ if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+ MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) {
status = MPR_DIAG_FAILURE;
mpr_dprint(sc, MPR_FAULT, "%s: release of FW Diag Buffer "
"failed with IOCStatus = 0x%x and IOCLogInfo = 0x%x\n",
- __func__, reply->IOCStatus, reply->IOCLogInfo);
+ __func__, le16toh(reply->IOCStatus),
+ le32toh(reply->IOCLogInfo));
goto done;
}
OpenPOWER on IntegriCloud