]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] fusion: endianess fixes
authorChristoph Hellwig <hch@lst.de>
Thu, 18 Aug 2005 14:25:44 +0000 (16:25 +0200)
committerJames Bottomley <jejb@mulgrave.(none)>
Mon, 5 Sep 2005 00:51:25 +0000 (19:51 -0500)
Assorted endianess fixes.  I'll work on full endianess annotations
later.

Acked by: Moore, Eric Dean <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptscsih.c

index 284202766804df65b9ae2e3d49fa300e6e0353c4..35444ba4e78ae28befccd4538eb3ebf62b848a00 100644 (file)
@@ -2185,7 +2185,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
                facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions);
                facts->IOCStatus = le16_to_cpu(facts->IOCStatus);
                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 */
 
                facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth);
@@ -4823,8 +4823,8 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
        pReq->Reserved3 = 0;
        pReq->NumAddressBytes = 0x01;
        pReq->Reserved4 = 0;
-       pReq->DataLength = 0x04;
-       pdev = (struct pci_dev *) ioc->pcidev;
+       pReq->DataLength = cpu_to_le16(0x04);
+       pdev = ioc->pcidev;
        if (pdev->devfn & 1)
                pReq->DeviceAddr = 0xB2;
        else
index e63a3fd6b7063df9cacc09cb07519102489ed680..7577c2417e2e124ca9109640a86cbe7fc4e9ddf7 100644 (file)
@@ -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
                 * 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)
                        ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD;
 
index b774f45dfde4c462cc7b8ee67dab0e14d9ee029c..cd4e8c0853d05d878daf5acda5e0d3be6819dff8 100644 (file)
@@ -3447,7 +3447,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
                                 * some type of error occurred.
                                 */
                                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;
                                else
                                        completionCode = MPT_SCANDV_SOME_ERROR;
@@ -3996,9 +3996,9 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum)
                        dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC "
                                "offset=0 negoFlags=%x request=%x config=%x\n",
                                id, flags, requested, configuration));
-                       pcfg1Data->RequestedParameters = le32_to_cpu(requested);
+                       pcfg1Data->RequestedParameters = cpu_to_le32(requested);
                        pcfg1Data->Reserved = 0;
-                       pcfg1Data->Configuration = le32_to_cpu(configuration);
+                       pcfg1Data->Configuration = cpu_to_le32(configuration);
                        cfg.pageAddr = (bus<<8) | id;
                        mpt_config(hd->ioc, &cfg);
                }
@@ -5248,7 +5248,7 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
                /* Update tmax values with those from Device Page 0.*/
                pPage0 = (SCSIDevicePage0_t *) pPage;
                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.offset = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) >> 16;
                        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)
                                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",
                                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->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));
                break;
 
@@ -5301,9 +5301,9 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
                                offset, &val, &configuration, negoFlags);
                        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));
-                       pPage1->RequestedParameters = le32_to_cpu(val);
+                       pPage1->RequestedParameters = cpu_to_le32(val);
                        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",
                                id, width, factor, offset, val, configuration, negoFlags));
@@ -5377,12 +5377,12 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage)
                if (pPage1) {
                        mptscsih_setDevicePage1Flags (width, factor, offset, &val,
                                                &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));
 
-                       pPage1->RequestedParameters = le32_to_cpu(val);
+                       pPage1->RequestedParameters = cpu_to_le32(val);
                        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",