diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-03-17 06:54:52 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 10:23:59 -0400 |
commit | e94f67472106e5a0e97c79090211c551e69e889b (patch) | |
tree | 653fdf5d1733a902c04517f0941ccbb69db9f428 /drivers/scsi/mpt2sas/mpt2sas_ctl.c | |
parent | b4344276f75827f609ebef886b292653bec38f92 (diff) |
[SCSI] mpt2sas: Fix for little endian
1. Fixes for little endian issues.
2. Now Debug info for Discovery event is more readable.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index fa9bf83819d5..ae55a912baf4 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c | |||
@@ -533,7 +533,7 @@ _ctl_set_task_mid(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | |||
533 | if (!found) { | 533 | if (!found) { |
534 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " | 534 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " |
535 | "handle(0x%04x), lun(%d), no active mid!!\n", ioc->name, | 535 | "handle(0x%04x), lun(%d), no active mid!!\n", ioc->name, |
536 | desc, tm_request->DevHandle, lun)); | 536 | desc, le16_to_cpu(tm_request->DevHandle), lun)); |
537 | tm_reply = ioc->ctl_cmds.reply; | 537 | tm_reply = ioc->ctl_cmds.reply; |
538 | tm_reply->DevHandle = tm_request->DevHandle; | 538 | tm_reply->DevHandle = tm_request->DevHandle; |
539 | tm_reply->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; | 539 | tm_reply->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; |
@@ -551,7 +551,8 @@ _ctl_set_task_mid(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | |||
551 | 551 | ||
552 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " | 552 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " |
553 | "handle(0x%04x), lun(%d), task_mid(%d)\n", ioc->name, | 553 | "handle(0x%04x), lun(%d), task_mid(%d)\n", ioc->name, |
554 | desc, tm_request->DevHandle, lun, tm_request->TaskMID)); | 554 | desc, le16_to_cpu(tm_request->DevHandle), lun, |
555 | le16_to_cpu(tm_request->TaskMID))); | ||
555 | return 0; | 556 | return 0; |
556 | } | 557 | } |
557 | 558 | ||
@@ -647,9 +648,9 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
647 | 648 | ||
648 | if (mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST || | 649 | if (mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST || |
649 | mpi_request->Function == MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH) { | 650 | mpi_request->Function == MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH) { |
650 | if (!mpi_request->FunctionDependent1 || | 651 | if (!le16_to_cpu(mpi_request->FunctionDependent1) || |
651 | mpi_request->FunctionDependent1 > | 652 | le16_to_cpu(mpi_request->FunctionDependent1) > |
652 | cpu_to_le16(ioc->facts.MaxDevHandle)) { | 653 | ioc->facts.MaxDevHandle) { |
653 | ret = -EINVAL; | 654 | ret = -EINVAL; |
654 | mpt2sas_base_free_smid(ioc, smid); | 655 | mpt2sas_base_free_smid(ioc, smid); |
655 | goto out; | 656 | goto out; |
@@ -897,11 +898,11 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
897 | MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) { | 898 | MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) { |
898 | printk(MPT2SAS_INFO_FMT "issue target reset: handle " | 899 | printk(MPT2SAS_INFO_FMT "issue target reset: handle " |
899 | "= (0x%04x)\n", ioc->name, | 900 | "= (0x%04x)\n", ioc->name, |
900 | mpi_request->FunctionDependent1); | 901 | le16_to_cpu(mpi_request->FunctionDependent1)); |
901 | mpt2sas_halt_firmware(ioc); | 902 | mpt2sas_halt_firmware(ioc); |
902 | mutex_lock(&ioc->tm_cmds.mutex); | 903 | mutex_lock(&ioc->tm_cmds.mutex); |
903 | mpt2sas_scsih_issue_tm(ioc, | 904 | mpt2sas_scsih_issue_tm(ioc, |
904 | mpi_request->FunctionDependent1, 0, | 905 | le16_to_cpu(mpi_request->FunctionDependent1), 0, |
905 | MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 10); | 906 | MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 10); |
906 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | 907 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; |
907 | mutex_unlock(&ioc->tm_cmds.mutex); | 908 | mutex_unlock(&ioc->tm_cmds.mutex); |
@@ -1373,7 +1374,8 @@ _ctl_diag_register_2(struct MPT2SAS_ADAPTER *ioc, | |||
1373 | 1374 | ||
1374 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: diag_buffer(0x%p), " | 1375 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: diag_buffer(0x%p), " |
1375 | "dma(0x%llx), sz(%d)\n", ioc->name, __func__, request_data, | 1376 | "dma(0x%llx), sz(%d)\n", ioc->name, __func__, request_data, |
1376 | (unsigned long long)request_data_dma, mpi_request->BufferLength)); | 1377 | (unsigned long long)request_data_dma, |
1378 | le32_to_cpu(mpi_request->BufferLength))); | ||
1377 | 1379 | ||
1378 | for (i = 0; i < MPT2_PRODUCT_SPECIFIC_DWORDS; i++) | 1380 | for (i = 0; i < MPT2_PRODUCT_SPECIFIC_DWORDS; i++) |
1379 | mpi_request->ProductSpecific[i] = | 1381 | mpi_request->ProductSpecific[i] = |
@@ -2334,8 +2336,8 @@ _ctl_version_nvdata_persistent_show(struct device *cdev, | |||
2334 | struct Scsi_Host *shost = class_to_shost(cdev); | 2336 | struct Scsi_Host *shost = class_to_shost(cdev); |
2335 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 2337 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
2336 | 2338 | ||
2337 | return snprintf(buf, PAGE_SIZE, "%02xh\n", | 2339 | return snprintf(buf, PAGE_SIZE, "%08xh\n", |
2338 | le16_to_cpu(ioc->iounit_pg0.NvdataVersionPersistent.Word)); | 2340 | le32_to_cpu(ioc->iounit_pg0.NvdataVersionPersistent.Word)); |
2339 | } | 2341 | } |
2340 | static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, | 2342 | static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, |
2341 | _ctl_version_nvdata_persistent_show, NULL); | 2343 | _ctl_version_nvdata_persistent_show, NULL); |
@@ -2354,8 +2356,8 @@ _ctl_version_nvdata_default_show(struct device *cdev, | |||
2354 | struct Scsi_Host *shost = class_to_shost(cdev); | 2356 | struct Scsi_Host *shost = class_to_shost(cdev); |
2355 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 2357 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
2356 | 2358 | ||
2357 | return snprintf(buf, PAGE_SIZE, "%02xh\n", | 2359 | return snprintf(buf, PAGE_SIZE, "%08xh\n", |
2358 | le16_to_cpu(ioc->iounit_pg0.NvdataVersionDefault.Word)); | 2360 | le32_to_cpu(ioc->iounit_pg0.NvdataVersionDefault.Word)); |
2359 | } | 2361 | } |
2360 | static DEVICE_ATTR(version_nvdata_default, S_IRUGO, | 2362 | static DEVICE_ATTR(version_nvdata_default, S_IRUGO, |
2361 | _ctl_version_nvdata_default_show, NULL); | 2363 | _ctl_version_nvdata_default_show, NULL); |