Commit 637fa99b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] fusion: endianess fixes

Assorted endianess fixes.  I'll work on full endianess annotations
later.

Acked by: Moore, Eric Dean <Eric.Moore@lsil.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent ccf3b7bd
...@@ -2185,7 +2185,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) ...@@ -2185,7 +2185,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions); facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions);
facts->IOCStatus = le16_to_cpu(facts->IOCStatus); facts->IOCStatus = le16_to_cpu(facts->IOCStatus);
facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo); facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo);
status = facts->IOCStatus & MPI_IOCSTATUS_MASK; status = le16_to_cpu(facts->IOCStatus) & MPI_IOCSTATUS_MASK;
/* CHECKME! IOCStatus, IOCLogInfo */ /* CHECKME! IOCStatus, IOCLogInfo */
facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth); facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth);
...@@ -4823,8 +4823,8 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) ...@@ -4823,8 +4823,8 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
pReq->Reserved3 = 0; pReq->Reserved3 = 0;
pReq->NumAddressBytes = 0x01; pReq->NumAddressBytes = 0x01;
pReq->Reserved4 = 0; pReq->Reserved4 = 0;
pReq->DataLength = 0x04; pReq->DataLength = cpu_to_le16(0x04);
pdev = (struct pci_dev *) ioc->pcidev; pdev = ioc->pcidev;
if (pdev->devfn & 1) if (pdev->devfn & 1)
pReq->DeviceAddr = 0xB2; pReq->DeviceAddr = 0xB2;
else else
......
...@@ -242,7 +242,7 @@ mptctl_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply) ...@@ -242,7 +242,7 @@ mptctl_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply)
/* Set the command status to GOOD if IOC Status is GOOD /* Set the command status to GOOD if IOC Status is GOOD
* OR if SCSI I/O cmd and data underrun or recovered error. * OR if SCSI I/O cmd and data underrun or recovered error.
*/ */
iocStatus = reply->u.reply.IOCStatus & MPI_IOCSTATUS_MASK; iocStatus = le16_to_cpu(reply->u.reply.IOCStatus) & MPI_IOCSTATUS_MASK;
if (iocStatus == MPI_IOCSTATUS_SUCCESS) if (iocStatus == MPI_IOCSTATUS_SUCCESS)
ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD; ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD;
......
...@@ -3447,7 +3447,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -3447,7 +3447,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
* some type of error occurred. * some type of error occurred.
*/ */
MpiRaidActionReply_t *pr = (MpiRaidActionReply_t *)mr; MpiRaidActionReply_t *pr = (MpiRaidActionReply_t *)mr;
if (pr->ActionStatus == MPI_RAID_ACTION_ASTATUS_SUCCESS) if (le16_to_cpu(pr->ActionStatus) == MPI_RAID_ACTION_ASTATUS_SUCCESS)
completionCode = MPT_SCANDV_GOOD; completionCode = MPT_SCANDV_GOOD;
else else
completionCode = MPT_SCANDV_SOME_ERROR; completionCode = MPT_SCANDV_SOME_ERROR;
...@@ -3996,9 +3996,9 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum) ...@@ -3996,9 +3996,9 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum)
dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC "
"offset=0 negoFlags=%x request=%x config=%x\n", "offset=0 negoFlags=%x request=%x config=%x\n",
id, flags, requested, configuration)); id, flags, requested, configuration));
pcfg1Data->RequestedParameters = le32_to_cpu(requested); pcfg1Data->RequestedParameters = cpu_to_le32(requested);
pcfg1Data->Reserved = 0; pcfg1Data->Reserved = 0;
pcfg1Data->Configuration = le32_to_cpu(configuration); pcfg1Data->Configuration = cpu_to_le32(configuration);
cfg.pageAddr = (bus<<8) | id; cfg.pageAddr = (bus<<8) | id;
mpt_config(hd->ioc, &cfg); mpt_config(hd->ioc, &cfg);
} }
...@@ -5248,7 +5248,7 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) ...@@ -5248,7 +5248,7 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
/* Update tmax values with those from Device Page 0.*/ /* Update tmax values with those from Device Page 0.*/
pPage0 = (SCSIDevicePage0_t *) pPage; pPage0 = (SCSIDevicePage0_t *) pPage;
if (pPage0) { if (pPage0) {
val = cpu_to_le32(pPage0->NegotiatedParameters); val = le32_to_cpu(pPage0->NegotiatedParameters);
dv->max.width = val & MPI_SCSIDEVPAGE0_NP_WIDE ? 1 : 0; dv->max.width = val & MPI_SCSIDEVPAGE0_NP_WIDE ? 1 : 0;
dv->max.offset = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) >> 16; dv->max.offset = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) >> 16;
dv->max.factor = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK) >> 8; dv->max.factor = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK) >> 8;
...@@ -5276,12 +5276,12 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) ...@@ -5276,12 +5276,12 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
dv->now.offset, &val, &configuration, dv->now.flags); dv->now.offset, &val, &configuration, dv->now.flags);
dnegoprintk(("Setting Max: id=%d width=%d factor=%x offset=%x negoFlags=%x request=%x config=%x\n", dnegoprintk(("Setting Max: id=%d width=%d factor=%x offset=%x negoFlags=%x request=%x config=%x\n",
id, dv->now.width, dv->now.factor, dv->now.offset, dv->now.flags, val, configuration)); id, dv->now.width, dv->now.factor, dv->now.offset, dv->now.flags, val, configuration));
pPage1->RequestedParameters = le32_to_cpu(val); pPage1->RequestedParameters = cpu_to_le32(val);
pPage1->Reserved = 0; pPage1->Reserved = 0;
pPage1->Configuration = le32_to_cpu(configuration); pPage1->Configuration = cpu_to_le32(configuration);
} }
ddvprintk(("id=%d width=%d factor=%x offset=%x flags=%x request=%x configuration=%x\n", ddvprintk(("id=%d width=%d factor=%x offset=%x negoFlags=%x request=%x configuration=%x\n",
id, dv->now.width, dv->now.factor, dv->now.offset, dv->now.flags, val, configuration)); id, dv->now.width, dv->now.factor, dv->now.offset, dv->now.flags, val, configuration));
break; break;
...@@ -5301,9 +5301,9 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) ...@@ -5301,9 +5301,9 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
offset, &val, &configuration, negoFlags); offset, &val, &configuration, negoFlags);
dnegoprintk(("Setting Min: id=%d width=%d factor=%x offset=%x negoFlags=%x request=%x config=%x\n", dnegoprintk(("Setting Min: id=%d width=%d factor=%x offset=%x negoFlags=%x request=%x config=%x\n",
id, width, factor, offset, negoFlags, val, configuration)); id, width, factor, offset, negoFlags, val, configuration));
pPage1->RequestedParameters = le32_to_cpu(val); pPage1->RequestedParameters = cpu_to_le32(val);
pPage1->Reserved = 0; pPage1->Reserved = 0;
pPage1->Configuration = le32_to_cpu(configuration); pPage1->Configuration = cpu_to_le32(configuration);
} }
ddvprintk(("id=%d width=%d factor=%x offset=%x request=%x config=%x negoFlags=%x\n", ddvprintk(("id=%d width=%d factor=%x offset=%x request=%x config=%x negoFlags=%x\n",
id, width, factor, offset, val, configuration, negoFlags)); id, width, factor, offset, val, configuration, negoFlags));
...@@ -5377,12 +5377,12 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) ...@@ -5377,12 +5377,12 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
if (pPage1) { if (pPage1) {
mptscsih_setDevicePage1Flags (width, factor, offset, &val, mptscsih_setDevicePage1Flags (width, factor, offset, &val,
&configuration, dv->now.flags); &configuration, dv->now.flags);
dnegoprintk(("Finish: id=%d width=%d offset=%d factor=%x flags=%x request=%x config=%x\n", dnegoprintk(("Finish: id=%d width=%d offset=%d factor=%x negoFlags=%x request=%x config=%x\n",
id, width, offset, factor, dv->now.flags, val, configuration)); id, width, offset, factor, dv->now.flags, val, configuration));
pPage1->RequestedParameters = le32_to_cpu(val); pPage1->RequestedParameters = cpu_to_le32(val);
pPage1->Reserved = 0; pPage1->Reserved = 0;
pPage1->Configuration = le32_to_cpu(configuration); pPage1->Configuration = cpu_to_le32(configuration);
} }
ddvprintk(("Finish: id=%d offset=%d factor=%x width=%d request=%x config=%x\n", ddvprintk(("Finish: id=%d offset=%d factor=%x width=%d request=%x config=%x\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment