diff options
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 5 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 32 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 363 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 59 |
4 files changed, 347 insertions, 112 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 36b1d1052ba1..286c185fa9e4 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <scsi/scsi_tcq.h> | 61 | #include <scsi/scsi_tcq.h> |
62 | #include <scsi/scsi_transport_sas.h> | 62 | #include <scsi/scsi_transport_sas.h> |
63 | #include <scsi/scsi_dbg.h> | 63 | #include <scsi/scsi_dbg.h> |
64 | #include <scsi/scsi_eh.h> | ||
64 | 65 | ||
65 | #include "mpt2sas_debug.h" | 66 | #include "mpt2sas_debug.h" |
66 | 67 | ||
@@ -68,10 +69,10 @@ | |||
68 | #define MPT2SAS_DRIVER_NAME "mpt2sas" | 69 | #define MPT2SAS_DRIVER_NAME "mpt2sas" |
69 | #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" | 70 | #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" |
70 | #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" | 71 | #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" |
71 | #define MPT2SAS_DRIVER_VERSION "01.100.02.00" | 72 | #define MPT2SAS_DRIVER_VERSION "01.100.03.00" |
72 | #define MPT2SAS_MAJOR_VERSION 01 | 73 | #define MPT2SAS_MAJOR_VERSION 01 |
73 | #define MPT2SAS_MINOR_VERSION 100 | 74 | #define MPT2SAS_MINOR_VERSION 100 |
74 | #define MPT2SAS_BUILD_VERSION 02 | 75 | #define MPT2SAS_BUILD_VERSION 03 |
75 | #define MPT2SAS_RELEASE_VERSION 00 | 76 | #define MPT2SAS_RELEASE_VERSION 00 |
76 | 77 | ||
77 | /* | 78 | /* |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index ba6ab170bdf0..14e473d1fa7b 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c | |||
@@ -473,7 +473,7 @@ _ctl_poll(struct file *filep, poll_table *wait) | |||
473 | } | 473 | } |
474 | 474 | ||
475 | /** | 475 | /** |
476 | * _ctl_do_task_abort - assign an active smid to the abort_task | 476 | * _ctl_set_task_mid - assign an active smid to tm request |
477 | * @ioc: per adapter object | 477 | * @ioc: per adapter object |
478 | * @karg - (struct mpt2_ioctl_command) | 478 | * @karg - (struct mpt2_ioctl_command) |
479 | * @tm_request - pointer to mf from user space | 479 | * @tm_request - pointer to mf from user space |
@@ -482,7 +482,7 @@ _ctl_poll(struct file *filep, poll_table *wait) | |||
482 | * during failure, the reply frame is filled. | 482 | * during failure, the reply frame is filled. |
483 | */ | 483 | */ |
484 | static int | 484 | static int |
485 | _ctl_do_task_abort(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | 485 | _ctl_set_task_mid(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, |
486 | Mpi2SCSITaskManagementRequest_t *tm_request) | 486 | Mpi2SCSITaskManagementRequest_t *tm_request) |
487 | { | 487 | { |
488 | u8 found = 0; | 488 | u8 found = 0; |
@@ -494,6 +494,14 @@ _ctl_do_task_abort(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | |||
494 | Mpi2SCSITaskManagementReply_t *tm_reply; | 494 | Mpi2SCSITaskManagementReply_t *tm_reply; |
495 | u32 sz; | 495 | u32 sz; |
496 | u32 lun; | 496 | u32 lun; |
497 | char *desc = NULL; | ||
498 | |||
499 | if (tm_request->TaskType == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) | ||
500 | desc = "abort_task"; | ||
501 | else if (tm_request->TaskType == MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK) | ||
502 | desc = "query_task"; | ||
503 | else | ||
504 | return 0; | ||
497 | 505 | ||
498 | lun = scsilun_to_int((struct scsi_lun *)tm_request->LUN); | 506 | lun = scsilun_to_int((struct scsi_lun *)tm_request->LUN); |
499 | 507 | ||
@@ -517,13 +525,13 @@ _ctl_do_task_abort(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | |||
517 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); | 525 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
518 | 526 | ||
519 | if (!found) { | 527 | if (!found) { |
520 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "ABORT_TASK: " | 528 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " |
521 | "DevHandle(0x%04x), lun(%d), no active mid!!\n", ioc->name, | 529 | "handle(0x%04x), lun(%d), no active mid!!\n", ioc->name, |
522 | tm_request->DevHandle, lun)); | 530 | desc, tm_request->DevHandle, lun)); |
523 | tm_reply = ioc->ctl_cmds.reply; | 531 | tm_reply = ioc->ctl_cmds.reply; |
524 | tm_reply->DevHandle = tm_request->DevHandle; | 532 | tm_reply->DevHandle = tm_request->DevHandle; |
525 | tm_reply->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; | 533 | tm_reply->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; |
526 | tm_reply->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK; | 534 | tm_reply->TaskType = tm_request->TaskType; |
527 | tm_reply->MsgLength = sizeof(Mpi2SCSITaskManagementReply_t)/4; | 535 | tm_reply->MsgLength = sizeof(Mpi2SCSITaskManagementReply_t)/4; |
528 | tm_reply->VP_ID = tm_request->VP_ID; | 536 | tm_reply->VP_ID = tm_request->VP_ID; |
529 | tm_reply->VF_ID = tm_request->VF_ID; | 537 | tm_reply->VF_ID = tm_request->VF_ID; |
@@ -535,9 +543,9 @@ _ctl_do_task_abort(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command *karg, | |||
535 | return 1; | 543 | return 1; |
536 | } | 544 | } |
537 | 545 | ||
538 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "ABORT_TASK: " | 546 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: " |
539 | "DevHandle(0x%04x), lun(%d), smid(%d)\n", ioc->name, | 547 | "handle(0x%04x), lun(%d), task_mid(%d)\n", ioc->name, |
540 | tm_request->DevHandle, lun, tm_request->TaskMID)); | 548 | desc, tm_request->DevHandle, lun, tm_request->TaskMID)); |
541 | return 0; | 549 | return 0; |
542 | } | 550 | } |
543 | 551 | ||
@@ -739,8 +747,10 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
739 | (Mpi2SCSITaskManagementRequest_t *)mpi_request; | 747 | (Mpi2SCSITaskManagementRequest_t *)mpi_request; |
740 | 748 | ||
741 | if (tm_request->TaskType == | 749 | if (tm_request->TaskType == |
742 | MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { | 750 | MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK || |
743 | if (_ctl_do_task_abort(ioc, &karg, tm_request)) { | 751 | tm_request->TaskType == |
752 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK) { | ||
753 | if (_ctl_set_task_mid(ioc, &karg, tm_request)) { | ||
744 | mpt2sas_base_free_smid(ioc, smid); | 754 | mpt2sas_base_free_smid(ioc, smid); |
745 | goto out; | 755 | goto out; |
746 | } | 756 | } |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index e3a7967259e7..2a01a5f2a84d 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -197,12 +197,12 @@ static struct pci_device_id scsih_pci_table[] = { | |||
197 | MODULE_DEVICE_TABLE(pci, scsih_pci_table); | 197 | MODULE_DEVICE_TABLE(pci, scsih_pci_table); |
198 | 198 | ||
199 | /** | 199 | /** |
200 | * scsih_set_debug_level - global setting of ioc->logging_level. | 200 | * _scsih_set_debug_level - global setting of ioc->logging_level. |
201 | * | 201 | * |
202 | * Note: The logging levels are defined in mpt2sas_debug.h. | 202 | * Note: The logging levels are defined in mpt2sas_debug.h. |
203 | */ | 203 | */ |
204 | static int | 204 | static int |
205 | scsih_set_debug_level(const char *val, struct kernel_param *kp) | 205 | _scsih_set_debug_level(const char *val, struct kernel_param *kp) |
206 | { | 206 | { |
207 | int ret = param_set_int(val, kp); | 207 | int ret = param_set_int(val, kp); |
208 | struct MPT2SAS_ADAPTER *ioc; | 208 | struct MPT2SAS_ADAPTER *ioc; |
@@ -215,7 +215,7 @@ scsih_set_debug_level(const char *val, struct kernel_param *kp) | |||
215 | ioc->logging_level = logging_level; | 215 | ioc->logging_level = logging_level; |
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | module_param_call(logging_level, scsih_set_debug_level, param_get_int, | 218 | module_param_call(logging_level, _scsih_set_debug_level, param_get_int, |
219 | &logging_level, 0644); | 219 | &logging_level, 0644); |
220 | 220 | ||
221 | /** | 221 | /** |
@@ -884,6 +884,41 @@ _scsih_scsi_lookup_find_by_target(struct MPT2SAS_ADAPTER *ioc, int id, | |||
884 | } | 884 | } |
885 | 885 | ||
886 | /** | 886 | /** |
887 | * _scsih_scsi_lookup_find_by_lun - search for matching channel:id:lun | ||
888 | * @ioc: per adapter object | ||
889 | * @id: target id | ||
890 | * @lun: lun number | ||
891 | * @channel: channel | ||
892 | * Context: This function will acquire ioc->scsi_lookup_lock. | ||
893 | * | ||
894 | * This will search for a matching channel:id:lun in the scsi_lookup array, | ||
895 | * returning 1 if found. | ||
896 | */ | ||
897 | static u8 | ||
898 | _scsih_scsi_lookup_find_by_lun(struct MPT2SAS_ADAPTER *ioc, int id, | ||
899 | unsigned int lun, int channel) | ||
900 | { | ||
901 | u8 found; | ||
902 | unsigned long flags; | ||
903 | int i; | ||
904 | |||
905 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); | ||
906 | found = 0; | ||
907 | for (i = 0 ; i < ioc->request_depth; i++) { | ||
908 | if (ioc->scsi_lookup[i].scmd && | ||
909 | (ioc->scsi_lookup[i].scmd->device->id == id && | ||
910 | ioc->scsi_lookup[i].scmd->device->channel == channel && | ||
911 | ioc->scsi_lookup[i].scmd->device->lun == lun)) { | ||
912 | found = 1; | ||
913 | goto out; | ||
914 | } | ||
915 | } | ||
916 | out: | ||
917 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); | ||
918 | return found; | ||
919 | } | ||
920 | |||
921 | /** | ||
887 | * _scsih_get_chain_buffer_dma - obtain block of chains (dma address) | 922 | * _scsih_get_chain_buffer_dma - obtain block of chains (dma address) |
888 | * @ioc: per adapter object | 923 | * @ioc: per adapter object |
889 | * @smid: system request message index | 924 | * @smid: system request message index |
@@ -1047,14 +1082,14 @@ _scsih_build_scatter_gather(struct MPT2SAS_ADAPTER *ioc, | |||
1047 | } | 1082 | } |
1048 | 1083 | ||
1049 | /** | 1084 | /** |
1050 | * scsih_change_queue_depth - setting device queue depth | 1085 | * _scsih_change_queue_depth - setting device queue depth |
1051 | * @sdev: scsi device struct | 1086 | * @sdev: scsi device struct |
1052 | * @qdepth: requested queue depth | 1087 | * @qdepth: requested queue depth |
1053 | * | 1088 | * |
1054 | * Returns queue depth. | 1089 | * Returns queue depth. |
1055 | */ | 1090 | */ |
1056 | static int | 1091 | static int |
1057 | scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | 1092 | _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) |
1058 | { | 1093 | { |
1059 | struct Scsi_Host *shost = sdev->host; | 1094 | struct Scsi_Host *shost = sdev->host; |
1060 | int max_depth; | 1095 | int max_depth; |
@@ -1079,14 +1114,14 @@ scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | |||
1079 | } | 1114 | } |
1080 | 1115 | ||
1081 | /** | 1116 | /** |
1082 | * scsih_change_queue_depth - changing device queue tag type | 1117 | * _scsih_change_queue_depth - changing device queue tag type |
1083 | * @sdev: scsi device struct | 1118 | * @sdev: scsi device struct |
1084 | * @tag_type: requested tag type | 1119 | * @tag_type: requested tag type |
1085 | * | 1120 | * |
1086 | * Returns queue tag type. | 1121 | * Returns queue tag type. |
1087 | */ | 1122 | */ |
1088 | static int | 1123 | static int |
1089 | scsih_change_queue_type(struct scsi_device *sdev, int tag_type) | 1124 | _scsih_change_queue_type(struct scsi_device *sdev, int tag_type) |
1090 | { | 1125 | { |
1091 | if (sdev->tagged_supported) { | 1126 | if (sdev->tagged_supported) { |
1092 | scsi_set_tag_type(sdev, tag_type); | 1127 | scsi_set_tag_type(sdev, tag_type); |
@@ -1101,14 +1136,14 @@ scsih_change_queue_type(struct scsi_device *sdev, int tag_type) | |||
1101 | } | 1136 | } |
1102 | 1137 | ||
1103 | /** | 1138 | /** |
1104 | * scsih_target_alloc - target add routine | 1139 | * _scsih_target_alloc - target add routine |
1105 | * @starget: scsi target struct | 1140 | * @starget: scsi target struct |
1106 | * | 1141 | * |
1107 | * Returns 0 if ok. Any other return is assumed to be an error and | 1142 | * Returns 0 if ok. Any other return is assumed to be an error and |
1108 | * the device is ignored. | 1143 | * the device is ignored. |
1109 | */ | 1144 | */ |
1110 | static int | 1145 | static int |
1111 | scsih_target_alloc(struct scsi_target *starget) | 1146 | _scsih_target_alloc(struct scsi_target *starget) |
1112 | { | 1147 | { |
1113 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); | 1148 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); |
1114 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 1149 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -1163,13 +1198,13 @@ scsih_target_alloc(struct scsi_target *starget) | |||
1163 | } | 1198 | } |
1164 | 1199 | ||
1165 | /** | 1200 | /** |
1166 | * scsih_target_destroy - target destroy routine | 1201 | * _scsih_target_destroy - target destroy routine |
1167 | * @starget: scsi target struct | 1202 | * @starget: scsi target struct |
1168 | * | 1203 | * |
1169 | * Returns nothing. | 1204 | * Returns nothing. |
1170 | */ | 1205 | */ |
1171 | static void | 1206 | static void |
1172 | scsih_target_destroy(struct scsi_target *starget) | 1207 | _scsih_target_destroy(struct scsi_target *starget) |
1173 | { | 1208 | { |
1174 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); | 1209 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); |
1175 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 1210 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -1212,14 +1247,14 @@ scsih_target_destroy(struct scsi_target *starget) | |||
1212 | } | 1247 | } |
1213 | 1248 | ||
1214 | /** | 1249 | /** |
1215 | * scsih_slave_alloc - device add routine | 1250 | * _scsih_slave_alloc - device add routine |
1216 | * @sdev: scsi device struct | 1251 | * @sdev: scsi device struct |
1217 | * | 1252 | * |
1218 | * Returns 0 if ok. Any other return is assumed to be an error and | 1253 | * Returns 0 if ok. Any other return is assumed to be an error and |
1219 | * the device is ignored. | 1254 | * the device is ignored. |
1220 | */ | 1255 | */ |
1221 | static int | 1256 | static int |
1222 | scsih_slave_alloc(struct scsi_device *sdev) | 1257 | _scsih_slave_alloc(struct scsi_device *sdev) |
1223 | { | 1258 | { |
1224 | struct Scsi_Host *shost; | 1259 | struct Scsi_Host *shost; |
1225 | struct MPT2SAS_ADAPTER *ioc; | 1260 | struct MPT2SAS_ADAPTER *ioc; |
@@ -1273,13 +1308,13 @@ scsih_slave_alloc(struct scsi_device *sdev) | |||
1273 | } | 1308 | } |
1274 | 1309 | ||
1275 | /** | 1310 | /** |
1276 | * scsih_slave_destroy - device destroy routine | 1311 | * _scsih_slave_destroy - device destroy routine |
1277 | * @sdev: scsi device struct | 1312 | * @sdev: scsi device struct |
1278 | * | 1313 | * |
1279 | * Returns nothing. | 1314 | * Returns nothing. |
1280 | */ | 1315 | */ |
1281 | static void | 1316 | static void |
1282 | scsih_slave_destroy(struct scsi_device *sdev) | 1317 | _scsih_slave_destroy(struct scsi_device *sdev) |
1283 | { | 1318 | { |
1284 | struct MPT2SAS_TARGET *sas_target_priv_data; | 1319 | struct MPT2SAS_TARGET *sas_target_priv_data; |
1285 | struct scsi_target *starget; | 1320 | struct scsi_target *starget; |
@@ -1295,13 +1330,13 @@ scsih_slave_destroy(struct scsi_device *sdev) | |||
1295 | } | 1330 | } |
1296 | 1331 | ||
1297 | /** | 1332 | /** |
1298 | * scsih_display_sata_capabilities - sata capabilities | 1333 | * _scsih_display_sata_capabilities - sata capabilities |
1299 | * @ioc: per adapter object | 1334 | * @ioc: per adapter object |
1300 | * @sas_device: the sas_device object | 1335 | * @sas_device: the sas_device object |
1301 | * @sdev: scsi device struct | 1336 | * @sdev: scsi device struct |
1302 | */ | 1337 | */ |
1303 | static void | 1338 | static void |
1304 | scsih_display_sata_capabilities(struct MPT2SAS_ADAPTER *ioc, | 1339 | _scsih_display_sata_capabilities(struct MPT2SAS_ADAPTER *ioc, |
1305 | struct _sas_device *sas_device, struct scsi_device *sdev) | 1340 | struct _sas_device *sas_device, struct scsi_device *sdev) |
1306 | { | 1341 | { |
1307 | Mpi2ConfigReply_t mpi_reply; | 1342 | Mpi2ConfigReply_t mpi_reply; |
@@ -1401,14 +1436,14 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, | |||
1401 | } | 1436 | } |
1402 | 1437 | ||
1403 | /** | 1438 | /** |
1404 | * scsih_slave_configure - device configure routine. | 1439 | * _scsih_slave_configure - device configure routine. |
1405 | * @sdev: scsi device struct | 1440 | * @sdev: scsi device struct |
1406 | * | 1441 | * |
1407 | * Returns 0 if ok. Any other return is assumed to be an error and | 1442 | * Returns 0 if ok. Any other return is assumed to be an error and |
1408 | * the device is ignored. | 1443 | * the device is ignored. |
1409 | */ | 1444 | */ |
1410 | static int | 1445 | static int |
1411 | scsih_slave_configure(struct scsi_device *sdev) | 1446 | _scsih_slave_configure(struct scsi_device *sdev) |
1412 | { | 1447 | { |
1413 | struct Scsi_Host *shost = sdev->host; | 1448 | struct Scsi_Host *shost = sdev->host; |
1414 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 1449 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -1489,7 +1524,7 @@ scsih_slave_configure(struct scsi_device *sdev) | |||
1489 | r_level, raid_device->handle, | 1524 | r_level, raid_device->handle, |
1490 | (unsigned long long)raid_device->wwid, | 1525 | (unsigned long long)raid_device->wwid, |
1491 | raid_device->num_pds, ds); | 1526 | raid_device->num_pds, ds); |
1492 | scsih_change_queue_depth(sdev, qdepth); | 1527 | _scsih_change_queue_depth(sdev, qdepth); |
1493 | return 0; | 1528 | return 0; |
1494 | } | 1529 | } |
1495 | 1530 | ||
@@ -1532,10 +1567,10 @@ scsih_slave_configure(struct scsi_device *sdev) | |||
1532 | sas_device->slot); | 1567 | sas_device->slot); |
1533 | 1568 | ||
1534 | if (!ssp_target) | 1569 | if (!ssp_target) |
1535 | scsih_display_sata_capabilities(ioc, sas_device, sdev); | 1570 | _scsih_display_sata_capabilities(ioc, sas_device, sdev); |
1536 | } | 1571 | } |
1537 | 1572 | ||
1538 | scsih_change_queue_depth(sdev, qdepth); | 1573 | _scsih_change_queue_depth(sdev, qdepth); |
1539 | 1574 | ||
1540 | if (ssp_target) | 1575 | if (ssp_target) |
1541 | sas_read_port_mode_page(sdev); | 1576 | sas_read_port_mode_page(sdev); |
@@ -1543,7 +1578,7 @@ scsih_slave_configure(struct scsi_device *sdev) | |||
1543 | } | 1578 | } |
1544 | 1579 | ||
1545 | /** | 1580 | /** |
1546 | * scsih_bios_param - fetch head, sector, cylinder info for a disk | 1581 | * _scsih_bios_param - fetch head, sector, cylinder info for a disk |
1547 | * @sdev: scsi device struct | 1582 | * @sdev: scsi device struct |
1548 | * @bdev: pointer to block device context | 1583 | * @bdev: pointer to block device context |
1549 | * @capacity: device size (in 512 byte sectors) | 1584 | * @capacity: device size (in 512 byte sectors) |
@@ -1555,7 +1590,7 @@ scsih_slave_configure(struct scsi_device *sdev) | |||
1555 | * Return nothing. | 1590 | * Return nothing. |
1556 | */ | 1591 | */ |
1557 | static int | 1592 | static int |
1558 | scsih_bios_param(struct scsi_device *sdev, struct block_device *bdev, | 1593 | _scsih_bios_param(struct scsi_device *sdev, struct block_device *bdev, |
1559 | sector_t capacity, int params[]) | 1594 | sector_t capacity, int params[]) |
1560 | { | 1595 | { |
1561 | int heads; | 1596 | int heads; |
@@ -1636,7 +1671,7 @@ _scsih_response_code(struct MPT2SAS_ADAPTER *ioc, u8 response_code) | |||
1636 | } | 1671 | } |
1637 | 1672 | ||
1638 | /** | 1673 | /** |
1639 | * scsih_tm_done - tm completion routine | 1674 | * _scsih_tm_done - tm completion routine |
1640 | * @ioc: per adapter object | 1675 | * @ioc: per adapter object |
1641 | * @smid: system request message index | 1676 | * @smid: system request message index |
1642 | * @VF_ID: virtual function id | 1677 | * @VF_ID: virtual function id |
@@ -1648,7 +1683,7 @@ _scsih_response_code(struct MPT2SAS_ADAPTER *ioc, u8 response_code) | |||
1648 | * Return nothing. | 1683 | * Return nothing. |
1649 | */ | 1684 | */ |
1650 | static void | 1685 | static void |
1651 | scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 1686 | _scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) |
1652 | { | 1687 | { |
1653 | MPI2DefaultReply_t *mpi_reply; | 1688 | MPI2DefaultReply_t *mpi_reply; |
1654 | 1689 | ||
@@ -1823,13 +1858,13 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, | |||
1823 | } | 1858 | } |
1824 | 1859 | ||
1825 | /** | 1860 | /** |
1826 | * scsih_abort - eh threads main abort routine | 1861 | * _scsih_abort - eh threads main abort routine |
1827 | * @sdev: scsi device struct | 1862 | * @sdev: scsi device struct |
1828 | * | 1863 | * |
1829 | * Returns SUCCESS if command aborted else FAILED | 1864 | * Returns SUCCESS if command aborted else FAILED |
1830 | */ | 1865 | */ |
1831 | static int | 1866 | static int |
1832 | scsih_abort(struct scsi_cmnd *scmd) | 1867 | _scsih_abort(struct scsi_cmnd *scmd) |
1833 | { | 1868 | { |
1834 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | 1869 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
1835 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 1870 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
@@ -1889,15 +1924,86 @@ scsih_abort(struct scsi_cmnd *scmd) | |||
1889 | return r; | 1924 | return r; |
1890 | } | 1925 | } |
1891 | 1926 | ||
1927 | /** | ||
1928 | * _scsih_dev_reset - eh threads main device reset routine | ||
1929 | * @sdev: scsi device struct | ||
1930 | * | ||
1931 | * Returns SUCCESS if command aborted else FAILED | ||
1932 | */ | ||
1933 | static int | ||
1934 | _scsih_dev_reset(struct scsi_cmnd *scmd) | ||
1935 | { | ||
1936 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | ||
1937 | struct MPT2SAS_DEVICE *sas_device_priv_data; | ||
1938 | struct _sas_device *sas_device; | ||
1939 | unsigned long flags; | ||
1940 | u16 handle; | ||
1941 | int r; | ||
1942 | |||
1943 | printk(MPT2SAS_INFO_FMT "attempting device reset! scmd(%p)\n", | ||
1944 | ioc->name, scmd); | ||
1945 | scsi_print_command(scmd); | ||
1946 | |||
1947 | sas_device_priv_data = scmd->device->hostdata; | ||
1948 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { | ||
1949 | printk(MPT2SAS_INFO_FMT "device been deleted! scmd(%p)\n", | ||
1950 | ioc->name, scmd); | ||
1951 | scmd->result = DID_NO_CONNECT << 16; | ||
1952 | scmd->scsi_done(scmd); | ||
1953 | r = SUCCESS; | ||
1954 | goto out; | ||
1955 | } | ||
1956 | |||
1957 | /* for hidden raid components obtain the volume_handle */ | ||
1958 | handle = 0; | ||
1959 | if (sas_device_priv_data->sas_target->flags & | ||
1960 | MPT_TARGET_FLAGS_RAID_COMPONENT) { | ||
1961 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | ||
1962 | sas_device = _scsih_sas_device_find_by_handle(ioc, | ||
1963 | sas_device_priv_data->sas_target->handle); | ||
1964 | if (sas_device) | ||
1965 | handle = sas_device->volume_handle; | ||
1966 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | ||
1967 | } else | ||
1968 | handle = sas_device_priv_data->sas_target->handle; | ||
1969 | |||
1970 | if (!handle) { | ||
1971 | scmd->result = DID_RESET << 16; | ||
1972 | r = FAILED; | ||
1973 | goto out; | ||
1974 | } | ||
1975 | |||
1976 | mutex_lock(&ioc->tm_cmds.mutex); | ||
1977 | mpt2sas_scsih_issue_tm(ioc, handle, 0, | ||
1978 | MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, scmd->device->lun, | ||
1979 | 30); | ||
1980 | |||
1981 | /* | ||
1982 | * sanity check see whether all commands to this device been | ||
1983 | * completed | ||
1984 | */ | ||
1985 | if (_scsih_scsi_lookup_find_by_lun(ioc, scmd->device->id, | ||
1986 | scmd->device->lun, scmd->device->channel)) | ||
1987 | r = FAILED; | ||
1988 | else | ||
1989 | r = SUCCESS; | ||
1990 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | ||
1991 | mutex_unlock(&ioc->tm_cmds.mutex); | ||
1992 | |||
1993 | out: | ||
1994 | printk(MPT2SAS_INFO_FMT "device reset: %s scmd(%p)\n", | ||
1995 | ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); | ||
1996 | return r; | ||
1997 | } | ||
1892 | 1998 | ||
1893 | /** | 1999 | /** |
1894 | * scsih_dev_reset - eh threads main device reset routine | 2000 | * _scsih_target_reset - eh threads main target reset routine |
1895 | * @sdev: scsi device struct | 2001 | * @sdev: scsi device struct |
1896 | * | 2002 | * |
1897 | * Returns SUCCESS if command aborted else FAILED | 2003 | * Returns SUCCESS if command aborted else FAILED |
1898 | */ | 2004 | */ |
1899 | static int | 2005 | static int |
1900 | scsih_dev_reset(struct scsi_cmnd *scmd) | 2006 | _scsih_target_reset(struct scsi_cmnd *scmd) |
1901 | { | 2007 | { |
1902 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | 2008 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
1903 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 2009 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
@@ -1912,7 +2018,7 @@ scsih_dev_reset(struct scsi_cmnd *scmd) | |||
1912 | 2018 | ||
1913 | sas_device_priv_data = scmd->device->hostdata; | 2019 | sas_device_priv_data = scmd->device->hostdata; |
1914 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { | 2020 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { |
1915 | printk(MPT2SAS_INFO_FMT "device been deleted! scmd(%p)\n", | 2021 | printk(MPT2SAS_INFO_FMT "target been deleted! scmd(%p)\n", |
1916 | ioc->name, scmd); | 2022 | ioc->name, scmd); |
1917 | scmd->result = DID_NO_CONNECT << 16; | 2023 | scmd->result = DID_NO_CONNECT << 16; |
1918 | scmd->scsi_done(scmd); | 2024 | scmd->scsi_done(scmd); |
@@ -1962,13 +2068,13 @@ scsih_dev_reset(struct scsi_cmnd *scmd) | |||
1962 | } | 2068 | } |
1963 | 2069 | ||
1964 | /** | 2070 | /** |
1965 | * scsih_abort - eh threads main host reset routine | 2071 | * _scsih_abort - eh threads main host reset routine |
1966 | * @sdev: scsi device struct | 2072 | * @sdev: scsi device struct |
1967 | * | 2073 | * |
1968 | * Returns SUCCESS if command aborted else FAILED | 2074 | * Returns SUCCESS if command aborted else FAILED |
1969 | */ | 2075 | */ |
1970 | static int | 2076 | static int |
1971 | scsih_host_reset(struct scsi_cmnd *scmd) | 2077 | _scsih_host_reset(struct scsi_cmnd *scmd) |
1972 | { | 2078 | { |
1973 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | 2079 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
1974 | int r, retval; | 2080 | int r, retval; |
@@ -2390,7 +2496,107 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | |||
2390 | } | 2496 | } |
2391 | 2497 | ||
2392 | /** | 2498 | /** |
2393 | * scsih_qcmd - main scsi request entry point | 2499 | * _scsih_setup_eedp - setup MPI request for EEDP transfer |
2500 | * @scmd: pointer to scsi command object | ||
2501 | * @mpi_request: pointer to the SCSI_IO reqest message frame | ||
2502 | * | ||
2503 | * Supporting protection 1 and 3. | ||
2504 | * | ||
2505 | * Returns nothing | ||
2506 | */ | ||
2507 | static void | ||
2508 | _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request) | ||
2509 | { | ||
2510 | u16 eedp_flags; | ||
2511 | unsigned char prot_op = scsi_get_prot_op(scmd); | ||
2512 | unsigned char prot_type = scsi_get_prot_type(scmd); | ||
2513 | |||
2514 | if (prot_type == SCSI_PROT_DIF_TYPE0 || | ||
2515 | prot_type == SCSI_PROT_DIF_TYPE2 || | ||
2516 | prot_op == SCSI_PROT_NORMAL) | ||
2517 | return; | ||
2518 | |||
2519 | if (prot_op == SCSI_PROT_READ_STRIP) | ||
2520 | eedp_flags = MPI2_SCSIIO_EEDPFLAGS_CHECK_REMOVE_OP; | ||
2521 | else if (prot_op == SCSI_PROT_WRITE_INSERT) | ||
2522 | eedp_flags = MPI2_SCSIIO_EEDPFLAGS_INSERT_OP; | ||
2523 | else | ||
2524 | return; | ||
2525 | |||
2526 | mpi_request->EEDPBlockSize = scmd->device->sector_size; | ||
2527 | |||
2528 | switch (prot_type) { | ||
2529 | case SCSI_PROT_DIF_TYPE1: | ||
2530 | |||
2531 | /* | ||
2532 | * enable ref/guard checking | ||
2533 | * auto increment ref tag | ||
2534 | */ | ||
2535 | mpi_request->EEDPFlags = eedp_flags | | ||
2536 | MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | | ||
2537 | MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | | ||
2538 | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; | ||
2539 | mpi_request->CDB.EEDP32.PrimaryReferenceTag = | ||
2540 | cpu_to_be32(scsi_get_lba(scmd)); | ||
2541 | |||
2542 | break; | ||
2543 | |||
2544 | case SCSI_PROT_DIF_TYPE3: | ||
2545 | |||
2546 | /* | ||
2547 | * enable guard checking | ||
2548 | */ | ||
2549 | mpi_request->EEDPFlags = eedp_flags | | ||
2550 | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; | ||
2551 | |||
2552 | break; | ||
2553 | } | ||
2554 | } | ||
2555 | |||
2556 | /** | ||
2557 | * _scsih_eedp_error_handling - return sense code for EEDP errors | ||
2558 | * @scmd: pointer to scsi command object | ||
2559 | * @ioc_status: ioc status | ||
2560 | * | ||
2561 | * Returns nothing | ||
2562 | */ | ||
2563 | static void | ||
2564 | _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) | ||
2565 | { | ||
2566 | u8 ascq; | ||
2567 | u8 sk; | ||
2568 | u8 host_byte; | ||
2569 | |||
2570 | switch (ioc_status) { | ||
2571 | case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: | ||
2572 | ascq = 0x01; | ||
2573 | break; | ||
2574 | case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: | ||
2575 | ascq = 0x02; | ||
2576 | break; | ||
2577 | case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: | ||
2578 | ascq = 0x03; | ||
2579 | break; | ||
2580 | default: | ||
2581 | ascq = 0x00; | ||
2582 | break; | ||
2583 | } | ||
2584 | |||
2585 | if (scmd->sc_data_direction == DMA_TO_DEVICE) { | ||
2586 | sk = ILLEGAL_REQUEST; | ||
2587 | host_byte = DID_ABORT; | ||
2588 | } else { | ||
2589 | sk = ABORTED_COMMAND; | ||
2590 | host_byte = DID_OK; | ||
2591 | } | ||
2592 | |||
2593 | scsi_build_sense_buffer(0, scmd->sense_buffer, sk, 0x10, ascq); | ||
2594 | scmd->result = DRIVER_SENSE << 24 | (host_byte << 16) | | ||
2595 | SAM_STAT_CHECK_CONDITION; | ||
2596 | } | ||
2597 | |||
2598 | /** | ||
2599 | * _scsih_qcmd - main scsi request entry point | ||
2394 | * @scmd: pointer to scsi command object | 2600 | * @scmd: pointer to scsi command object |
2395 | * @done: function pointer to be invoked on completion | 2601 | * @done: function pointer to be invoked on completion |
2396 | * | 2602 | * |
@@ -2401,7 +2607,7 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | |||
2401 | * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full | 2607 | * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full |
2402 | */ | 2608 | */ |
2403 | static int | 2609 | static int |
2404 | scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | 2610 | _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) |
2405 | { | 2611 | { |
2406 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | 2612 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
2407 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 2613 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
@@ -2470,6 +2676,7 @@ scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | |||
2470 | } | 2676 | } |
2471 | mpi_request = mpt2sas_base_get_msg_frame(ioc, smid); | 2677 | mpi_request = mpt2sas_base_get_msg_frame(ioc, smid); |
2472 | memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t)); | 2678 | memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t)); |
2679 | _scsih_setup_eedp(scmd, mpi_request); | ||
2473 | mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; | 2680 | mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; |
2474 | if (sas_device_priv_data->sas_target->flags & | 2681 | if (sas_device_priv_data->sas_target->flags & |
2475 | MPT_TARGET_FLAGS_RAID_COMPONENT) | 2682 | MPT_TARGET_FLAGS_RAID_COMPONENT) |
@@ -2604,6 +2811,15 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, | |||
2604 | case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: | 2811 | case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: |
2605 | desc_ioc_state = "scsi ext terminated"; | 2812 | desc_ioc_state = "scsi ext terminated"; |
2606 | break; | 2813 | break; |
2814 | case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: | ||
2815 | desc_ioc_state = "eedp guard error"; | ||
2816 | break; | ||
2817 | case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: | ||
2818 | desc_ioc_state = "eedp ref tag error"; | ||
2819 | break; | ||
2820 | case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: | ||
2821 | desc_ioc_state = "eedp app tag error"; | ||
2822 | break; | ||
2607 | default: | 2823 | default: |
2608 | desc_ioc_state = "unknown"; | 2824 | desc_ioc_state = "unknown"; |
2609 | break; | 2825 | break; |
@@ -2783,7 +2999,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle) | |||
2783 | } | 2999 | } |
2784 | 3000 | ||
2785 | /** | 3001 | /** |
2786 | * scsih_io_done - scsi request callback | 3002 | * _scsih_io_done - scsi request callback |
2787 | * @ioc: per adapter object | 3003 | * @ioc: per adapter object |
2788 | * @smid: system request message index | 3004 | * @smid: system request message index |
2789 | * @VF_ID: virtual function id | 3005 | * @VF_ID: virtual function id |
@@ -2794,7 +3010,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle) | |||
2794 | * Return nothing. | 3010 | * Return nothing. |
2795 | */ | 3011 | */ |
2796 | static void | 3012 | static void |
2797 | scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 3013 | _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) |
2798 | { | 3014 | { |
2799 | Mpi2SCSIIORequest_t *mpi_request; | 3015 | Mpi2SCSIIORequest_t *mpi_request; |
2800 | Mpi2SCSIIOReply_t *mpi_reply; | 3016 | Mpi2SCSIIOReply_t *mpi_reply; |
@@ -2939,6 +3155,11 @@ scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | |||
2939 | scmd->result = DID_RESET << 16; | 3155 | scmd->result = DID_RESET << 16; |
2940 | break; | 3156 | break; |
2941 | 3157 | ||
3158 | case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: | ||
3159 | case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: | ||
3160 | case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: | ||
3161 | _scsih_eedp_error_handling(scmd, ioc_status); | ||
3162 | break; | ||
2942 | case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: | 3163 | case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: |
2943 | case MPI2_IOCSTATUS_INVALID_FUNCTION: | 3164 | case MPI2_IOCSTATUS_INVALID_FUNCTION: |
2944 | case MPI2_IOCSTATUS_INVALID_SGL: | 3165 | case MPI2_IOCSTATUS_INVALID_SGL: |
@@ -5130,18 +5351,19 @@ static struct scsi_host_template scsih_driver_template = { | |||
5130 | .module = THIS_MODULE, | 5351 | .module = THIS_MODULE, |
5131 | .name = "Fusion MPT SAS Host", | 5352 | .name = "Fusion MPT SAS Host", |
5132 | .proc_name = MPT2SAS_DRIVER_NAME, | 5353 | .proc_name = MPT2SAS_DRIVER_NAME, |
5133 | .queuecommand = scsih_qcmd, | 5354 | .queuecommand = _scsih_qcmd, |
5134 | .target_alloc = scsih_target_alloc, | 5355 | .target_alloc = _scsih_target_alloc, |
5135 | .slave_alloc = scsih_slave_alloc, | 5356 | .slave_alloc = _scsih_slave_alloc, |
5136 | .slave_configure = scsih_slave_configure, | 5357 | .slave_configure = _scsih_slave_configure, |
5137 | .target_destroy = scsih_target_destroy, | 5358 | .target_destroy = _scsih_target_destroy, |
5138 | .slave_destroy = scsih_slave_destroy, | 5359 | .slave_destroy = _scsih_slave_destroy, |
5139 | .change_queue_depth = scsih_change_queue_depth, | 5360 | .change_queue_depth = _scsih_change_queue_depth, |
5140 | .change_queue_type = scsih_change_queue_type, | 5361 | .change_queue_type = _scsih_change_queue_type, |
5141 | .eh_abort_handler = scsih_abort, | 5362 | .eh_abort_handler = _scsih_abort, |
5142 | .eh_device_reset_handler = scsih_dev_reset, | 5363 | .eh_device_reset_handler = _scsih_dev_reset, |
5143 | .eh_host_reset_handler = scsih_host_reset, | 5364 | .eh_target_reset_handler = _scsih_target_reset, |
5144 | .bios_param = scsih_bios_param, | 5365 | .eh_host_reset_handler = _scsih_host_reset, |
5366 | .bios_param = _scsih_bios_param, | ||
5145 | .can_queue = 1, | 5367 | .can_queue = 1, |
5146 | .this_id = -1, | 5368 | .this_id = -1, |
5147 | .sg_tablesize = MPT2SAS_SG_DEPTH, | 5369 | .sg_tablesize = MPT2SAS_SG_DEPTH, |
@@ -5228,13 +5450,13 @@ _scsih_expander_node_remove(struct MPT2SAS_ADAPTER *ioc, | |||
5228 | } | 5450 | } |
5229 | 5451 | ||
5230 | /** | 5452 | /** |
5231 | * scsih_remove - detach and remove add host | 5453 | * _scsih_remove - detach and remove add host |
5232 | * @pdev: PCI device struct | 5454 | * @pdev: PCI device struct |
5233 | * | 5455 | * |
5234 | * Return nothing. | 5456 | * Return nothing. |
5235 | */ | 5457 | */ |
5236 | static void __devexit | 5458 | static void __devexit |
5237 | scsih_remove(struct pci_dev *pdev) | 5459 | _scsih_remove(struct pci_dev *pdev) |
5238 | { | 5460 | { |
5239 | struct Scsi_Host *shost = pci_get_drvdata(pdev); | 5461 | struct Scsi_Host *shost = pci_get_drvdata(pdev); |
5240 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 5462 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -5442,14 +5664,14 @@ _scsih_probe_devices(struct MPT2SAS_ADAPTER *ioc) | |||
5442 | } | 5664 | } |
5443 | 5665 | ||
5444 | /** | 5666 | /** |
5445 | * scsih_probe - attach and add scsi host | 5667 | * _scsih_probe - attach and add scsi host |
5446 | * @pdev: PCI device struct | 5668 | * @pdev: PCI device struct |
5447 | * @id: pci device id | 5669 | * @id: pci device id |
5448 | * | 5670 | * |
5449 | * Returns 0 success, anything else error. | 5671 | * Returns 0 success, anything else error. |
5450 | */ | 5672 | */ |
5451 | static int | 5673 | static int |
5452 | scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 5674 | _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
5453 | { | 5675 | { |
5454 | struct MPT2SAS_ADAPTER *ioc; | 5676 | struct MPT2SAS_ADAPTER *ioc; |
5455 | struct Scsi_Host *shost; | 5677 | struct Scsi_Host *shost; |
@@ -5503,6 +5725,9 @@ scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
5503 | goto out_add_shost_fail; | 5725 | goto out_add_shost_fail; |
5504 | } | 5726 | } |
5505 | 5727 | ||
5728 | scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION | ||
5729 | | SHOST_DIF_TYPE3_PROTECTION); | ||
5730 | |||
5506 | /* event thread */ | 5731 | /* event thread */ |
5507 | snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name), | 5732 | snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name), |
5508 | "fw_event%d", ioc->id); | 5733 | "fw_event%d", ioc->id); |
@@ -5536,14 +5761,14 @@ scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
5536 | 5761 | ||
5537 | #ifdef CONFIG_PM | 5762 | #ifdef CONFIG_PM |
5538 | /** | 5763 | /** |
5539 | * scsih_suspend - power management suspend main entry point | 5764 | * _scsih_suspend - power management suspend main entry point |
5540 | * @pdev: PCI device struct | 5765 | * @pdev: PCI device struct |
5541 | * @state: PM state change to (usually PCI_D3) | 5766 | * @state: PM state change to (usually PCI_D3) |
5542 | * | 5767 | * |
5543 | * Returns 0 success, anything else error. | 5768 | * Returns 0 success, anything else error. |
5544 | */ | 5769 | */ |
5545 | static int | 5770 | static int |
5546 | scsih_suspend(struct pci_dev *pdev, pm_message_t state) | 5771 | _scsih_suspend(struct pci_dev *pdev, pm_message_t state) |
5547 | { | 5772 | { |
5548 | struct Scsi_Host *shost = pci_get_drvdata(pdev); | 5773 | struct Scsi_Host *shost = pci_get_drvdata(pdev); |
5549 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 5774 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -5564,13 +5789,13 @@ scsih_suspend(struct pci_dev *pdev, pm_message_t state) | |||
5564 | } | 5789 | } |
5565 | 5790 | ||
5566 | /** | 5791 | /** |
5567 | * scsih_resume - power management resume main entry point | 5792 | * _scsih_resume - power management resume main entry point |
5568 | * @pdev: PCI device struct | 5793 | * @pdev: PCI device struct |
5569 | * | 5794 | * |
5570 | * Returns 0 success, anything else error. | 5795 | * Returns 0 success, anything else error. |
5571 | */ | 5796 | */ |
5572 | static int | 5797 | static int |
5573 | scsih_resume(struct pci_dev *pdev) | 5798 | _scsih_resume(struct pci_dev *pdev) |
5574 | { | 5799 | { |
5575 | struct Scsi_Host *shost = pci_get_drvdata(pdev); | 5800 | struct Scsi_Host *shost = pci_get_drvdata(pdev); |
5576 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 5801 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -5599,22 +5824,22 @@ scsih_resume(struct pci_dev *pdev) | |||
5599 | static struct pci_driver scsih_driver = { | 5824 | static struct pci_driver scsih_driver = { |
5600 | .name = MPT2SAS_DRIVER_NAME, | 5825 | .name = MPT2SAS_DRIVER_NAME, |
5601 | .id_table = scsih_pci_table, | 5826 | .id_table = scsih_pci_table, |
5602 | .probe = scsih_probe, | 5827 | .probe = _scsih_probe, |
5603 | .remove = __devexit_p(scsih_remove), | 5828 | .remove = __devexit_p(_scsih_remove), |
5604 | #ifdef CONFIG_PM | 5829 | #ifdef CONFIG_PM |
5605 | .suspend = scsih_suspend, | 5830 | .suspend = _scsih_suspend, |
5606 | .resume = scsih_resume, | 5831 | .resume = _scsih_resume, |
5607 | #endif | 5832 | #endif |
5608 | }; | 5833 | }; |
5609 | 5834 | ||
5610 | 5835 | ||
5611 | /** | 5836 | /** |
5612 | * scsih_init - main entry point for this driver. | 5837 | * _scsih_init - main entry point for this driver. |
5613 | * | 5838 | * |
5614 | * Returns 0 success, anything else error. | 5839 | * Returns 0 success, anything else error. |
5615 | */ | 5840 | */ |
5616 | static int __init | 5841 | static int __init |
5617 | scsih_init(void) | 5842 | _scsih_init(void) |
5618 | { | 5843 | { |
5619 | int error; | 5844 | int error; |
5620 | 5845 | ||
@@ -5630,10 +5855,10 @@ scsih_init(void) | |||
5630 | mpt2sas_base_initialize_callback_handler(); | 5855 | mpt2sas_base_initialize_callback_handler(); |
5631 | 5856 | ||
5632 | /* queuecommand callback hander */ | 5857 | /* queuecommand callback hander */ |
5633 | scsi_io_cb_idx = mpt2sas_base_register_callback_handler(scsih_io_done); | 5858 | scsi_io_cb_idx = mpt2sas_base_register_callback_handler(_scsih_io_done); |
5634 | 5859 | ||
5635 | /* task managment callback handler */ | 5860 | /* task managment callback handler */ |
5636 | tm_cb_idx = mpt2sas_base_register_callback_handler(scsih_tm_done); | 5861 | tm_cb_idx = mpt2sas_base_register_callback_handler(_scsih_tm_done); |
5637 | 5862 | ||
5638 | /* base internal commands callback handler */ | 5863 | /* base internal commands callback handler */ |
5639 | base_cb_idx = mpt2sas_base_register_callback_handler(mpt2sas_base_done); | 5864 | base_cb_idx = mpt2sas_base_register_callback_handler(mpt2sas_base_done); |
@@ -5659,12 +5884,12 @@ scsih_init(void) | |||
5659 | } | 5884 | } |
5660 | 5885 | ||
5661 | /** | 5886 | /** |
5662 | * scsih_exit - exit point for this driver (when it is a module). | 5887 | * _scsih_exit - exit point for this driver (when it is a module). |
5663 | * | 5888 | * |
5664 | * Returns 0 success, anything else error. | 5889 | * Returns 0 success, anything else error. |
5665 | */ | 5890 | */ |
5666 | static void __exit | 5891 | static void __exit |
5667 | scsih_exit(void) | 5892 | _scsih_exit(void) |
5668 | { | 5893 | { |
5669 | printk(KERN_INFO "mpt2sas version %s unloading\n", | 5894 | printk(KERN_INFO "mpt2sas version %s unloading\n", |
5670 | MPT2SAS_DRIVER_VERSION); | 5895 | MPT2SAS_DRIVER_VERSION); |
@@ -5682,5 +5907,5 @@ scsih_exit(void) | |||
5682 | mpt2sas_ctl_exit(); | 5907 | mpt2sas_ctl_exit(); |
5683 | } | 5908 | } |
5684 | 5909 | ||
5685 | module_init(scsih_init); | 5910 | module_init(_scsih_init); |
5686 | module_exit(scsih_exit); | 5911 | module_exit(_scsih_exit); |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index e03dc0b1e1a0..686695b155c7 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -264,7 +264,7 @@ struct rep_manu_reply{ | |||
264 | }; | 264 | }; |
265 | 265 | ||
266 | /** | 266 | /** |
267 | * transport_expander_report_manufacture - obtain SMP report_manufacture | 267 | * _transport_expander_report_manufacture - obtain SMP report_manufacture |
268 | * @ioc: per adapter object | 268 | * @ioc: per adapter object |
269 | * @sas_address: expander sas address | 269 | * @sas_address: expander sas address |
270 | * @edev: the sas_expander_device object | 270 | * @edev: the sas_expander_device object |
@@ -274,7 +274,7 @@ struct rep_manu_reply{ | |||
274 | * Returns 0 for success, non-zero for failure. | 274 | * Returns 0 for success, non-zero for failure. |
275 | */ | 275 | */ |
276 | static int | 276 | static int |
277 | transport_expander_report_manufacture(struct MPT2SAS_ADAPTER *ioc, | 277 | _transport_expander_report_manufacture(struct MPT2SAS_ADAPTER *ioc, |
278 | u64 sas_address, struct sas_expander_device *edev) | 278 | u64 sas_address, struct sas_expander_device *edev) |
279 | { | 279 | { |
280 | Mpi2SmpPassthroughRequest_t *mpi_request; | 280 | Mpi2SmpPassthroughRequest_t *mpi_request; |
@@ -578,7 +578,7 @@ mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
578 | MPI2_SAS_DEVICE_INFO_EDGE_EXPANDER || | 578 | MPI2_SAS_DEVICE_INFO_EDGE_EXPANDER || |
579 | mpt2sas_port->remote_identify.device_type == | 579 | mpt2sas_port->remote_identify.device_type == |
580 | MPI2_SAS_DEVICE_INFO_FANOUT_EXPANDER) | 580 | MPI2_SAS_DEVICE_INFO_FANOUT_EXPANDER) |
581 | transport_expander_report_manufacture(ioc, | 581 | _transport_expander_report_manufacture(ioc, |
582 | mpt2sas_port->remote_identify.sas_address, | 582 | mpt2sas_port->remote_identify.sas_address, |
583 | rphy_to_expander_device(rphy)); | 583 | rphy_to_expander_device(rphy)); |
584 | 584 | ||
@@ -852,7 +852,7 @@ rphy_to_ioc(struct sas_rphy *rphy) | |||
852 | } | 852 | } |
853 | 853 | ||
854 | /** | 854 | /** |
855 | * transport_get_linkerrors - | 855 | * _transport_get_linkerrors - |
856 | * @phy: The sas phy object | 856 | * @phy: The sas phy object |
857 | * | 857 | * |
858 | * Only support sas_host direct attached phys. | 858 | * Only support sas_host direct attached phys. |
@@ -860,7 +860,7 @@ rphy_to_ioc(struct sas_rphy *rphy) | |||
860 | * | 860 | * |
861 | */ | 861 | */ |
862 | static int | 862 | static int |
863 | transport_get_linkerrors(struct sas_phy *phy) | 863 | _transport_get_linkerrors(struct sas_phy *phy) |
864 | { | 864 | { |
865 | struct MPT2SAS_ADAPTER *ioc = phy_to_ioc(phy); | 865 | struct MPT2SAS_ADAPTER *ioc = phy_to_ioc(phy); |
866 | struct _sas_phy *mpt2sas_phy; | 866 | struct _sas_phy *mpt2sas_phy; |
@@ -903,14 +903,14 @@ transport_get_linkerrors(struct sas_phy *phy) | |||
903 | } | 903 | } |
904 | 904 | ||
905 | /** | 905 | /** |
906 | * transport_get_enclosure_identifier - | 906 | * _transport_get_enclosure_identifier - |
907 | * @phy: The sas phy object | 907 | * @phy: The sas phy object |
908 | * | 908 | * |
909 | * Obtain the enclosure logical id for an expander. | 909 | * Obtain the enclosure logical id for an expander. |
910 | * Returns 0 for success, non-zero for failure. | 910 | * Returns 0 for success, non-zero for failure. |
911 | */ | 911 | */ |
912 | static int | 912 | static int |
913 | transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) | 913 | _transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) |
914 | { | 914 | { |
915 | struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy); | 915 | struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy); |
916 | struct _sas_node *sas_expander; | 916 | struct _sas_node *sas_expander; |
@@ -929,13 +929,13 @@ transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) | |||
929 | } | 929 | } |
930 | 930 | ||
931 | /** | 931 | /** |
932 | * transport_get_bay_identifier - | 932 | * _transport_get_bay_identifier - |
933 | * @phy: The sas phy object | 933 | * @phy: The sas phy object |
934 | * | 934 | * |
935 | * Returns the slot id for a device that resides inside an enclosure. | 935 | * Returns the slot id for a device that resides inside an enclosure. |
936 | */ | 936 | */ |
937 | static int | 937 | static int |
938 | transport_get_bay_identifier(struct sas_rphy *rphy) | 938 | _transport_get_bay_identifier(struct sas_rphy *rphy) |
939 | { | 939 | { |
940 | struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy); | 940 | struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy); |
941 | struct _sas_device *sas_device; | 941 | struct _sas_device *sas_device; |
@@ -953,7 +953,7 @@ transport_get_bay_identifier(struct sas_rphy *rphy) | |||
953 | } | 953 | } |
954 | 954 | ||
955 | /** | 955 | /** |
956 | * transport_phy_reset - | 956 | * _transport_phy_reset - |
957 | * @phy: The sas phy object | 957 | * @phy: The sas phy object |
958 | * @hard_reset: | 958 | * @hard_reset: |
959 | * | 959 | * |
@@ -961,7 +961,7 @@ transport_get_bay_identifier(struct sas_rphy *rphy) | |||
961 | * Returns 0 for success, non-zero for failure. | 961 | * Returns 0 for success, non-zero for failure. |
962 | */ | 962 | */ |
963 | static int | 963 | static int |
964 | transport_phy_reset(struct sas_phy *phy, int hard_reset) | 964 | _transport_phy_reset(struct sas_phy *phy, int hard_reset) |
965 | { | 965 | { |
966 | struct MPT2SAS_ADAPTER *ioc = phy_to_ioc(phy); | 966 | struct MPT2SAS_ADAPTER *ioc = phy_to_ioc(phy); |
967 | struct _sas_phy *mpt2sas_phy; | 967 | struct _sas_phy *mpt2sas_phy; |
@@ -1002,7 +1002,7 @@ transport_phy_reset(struct sas_phy *phy, int hard_reset) | |||
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | /** | 1004 | /** |
1005 | * transport_smp_handler - transport portal for smp passthru | 1005 | * _transport_smp_handler - transport portal for smp passthru |
1006 | * @shost: shost object | 1006 | * @shost: shost object |
1007 | * @rphy: sas transport rphy object | 1007 | * @rphy: sas transport rphy object |
1008 | * @req: | 1008 | * @req: |
@@ -1012,7 +1012,7 @@ transport_phy_reset(struct sas_phy *phy, int hard_reset) | |||
1012 | * smp_rep_general /sys/class/bsg/expander-5:0 | 1012 | * smp_rep_general /sys/class/bsg/expander-5:0 |
1013 | */ | 1013 | */ |
1014 | static int | 1014 | static int |
1015 | transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | 1015 | _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, |
1016 | struct request *req) | 1016 | struct request *req) |
1017 | { | 1017 | { |
1018 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 1018 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
@@ -1041,7 +1041,7 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1041 | if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { | 1041 | if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { |
1042 | printk(MPT2SAS_ERR_FMT "%s: multiple segments req %u %u, " | 1042 | printk(MPT2SAS_ERR_FMT "%s: multiple segments req %u %u, " |
1043 | "rsp %u %u\n", ioc->name, __func__, req->bio->bi_vcnt, | 1043 | "rsp %u %u\n", ioc->name, __func__, req->bio->bi_vcnt, |
1044 | req->data_len, rsp->bio->bi_vcnt, rsp->data_len); | 1044 | blk_rq_bytes(req), rsp->bio->bi_vcnt, blk_rq_bytes(rsp)); |
1045 | return -EINVAL; | 1045 | return -EINVAL; |
1046 | } | 1046 | } |
1047 | 1047 | ||
@@ -1104,7 +1104,7 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1104 | *((u64 *)&mpi_request->SASAddress) = (rphy) ? | 1104 | *((u64 *)&mpi_request->SASAddress) = (rphy) ? |
1105 | cpu_to_le64(rphy->identify.sas_address) : | 1105 | cpu_to_le64(rphy->identify.sas_address) : |
1106 | cpu_to_le64(ioc->sas_hba.sas_address); | 1106 | cpu_to_le64(ioc->sas_hba.sas_address); |
1107 | mpi_request->RequestDataLength = cpu_to_le16(req->data_len - 4); | 1107 | mpi_request->RequestDataLength = cpu_to_le16(blk_rq_bytes(req) - 4); |
1108 | psge = &mpi_request->SGL; | 1108 | psge = &mpi_request->SGL; |
1109 | 1109 | ||
1110 | /* WRITE sgel first */ | 1110 | /* WRITE sgel first */ |
@@ -1112,13 +1112,13 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1112 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); | 1112 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); |
1113 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 1113 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
1114 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), | 1114 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), |
1115 | req->data_len, PCI_DMA_BIDIRECTIONAL); | 1115 | blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL); |
1116 | if (!dma_addr_out) { | 1116 | if (!dma_addr_out) { |
1117 | mpt2sas_base_free_smid(ioc, le16_to_cpu(smid)); | 1117 | mpt2sas_base_free_smid(ioc, le16_to_cpu(smid)); |
1118 | goto unmap; | 1118 | goto unmap; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | ioc->base_add_sg_single(psge, sgl_flags | (req->data_len - 4), | 1121 | ioc->base_add_sg_single(psge, sgl_flags | (blk_rq_bytes(req) - 4), |
1122 | dma_addr_out); | 1122 | dma_addr_out); |
1123 | 1123 | ||
1124 | /* incr sgel */ | 1124 | /* incr sgel */ |
@@ -1129,14 +1129,14 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1129 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | | 1129 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | |
1130 | MPI2_SGE_FLAGS_END_OF_LIST); | 1130 | MPI2_SGE_FLAGS_END_OF_LIST); |
1131 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 1131 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
1132 | dma_addr_in = pci_map_single(ioc->pdev, bio_data(rsp->bio), | 1132 | dma_addr_in = pci_map_single(ioc->pdev, bio_data(rsp->bio), |
1133 | rsp->data_len, PCI_DMA_BIDIRECTIONAL); | 1133 | blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL); |
1134 | if (!dma_addr_in) { | 1134 | if (!dma_addr_in) { |
1135 | mpt2sas_base_free_smid(ioc, le16_to_cpu(smid)); | 1135 | mpt2sas_base_free_smid(ioc, le16_to_cpu(smid)); |
1136 | goto unmap; | 1136 | goto unmap; |
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | ioc->base_add_sg_single(psge, sgl_flags | (rsp->data_len + 4), | 1139 | ioc->base_add_sg_single(psge, sgl_flags | (blk_rq_bytes(rsp) + 4), |
1140 | dma_addr_in); | 1140 | dma_addr_in); |
1141 | 1141 | ||
1142 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s - " | 1142 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s - " |
@@ -1170,9 +1170,8 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1170 | 1170 | ||
1171 | memcpy(req->sense, mpi_reply, sizeof(*mpi_reply)); | 1171 | memcpy(req->sense, mpi_reply, sizeof(*mpi_reply)); |
1172 | req->sense_len = sizeof(*mpi_reply); | 1172 | req->sense_len = sizeof(*mpi_reply); |
1173 | req->data_len = 0; | 1173 | req->resid_len = 0; |
1174 | rsp->data_len -= mpi_reply->ResponseDataLength; | 1174 | rsp->resid_len -= mpi_reply->ResponseDataLength; |
1175 | |||
1176 | } else { | 1175 | } else { |
1177 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT | 1176 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT |
1178 | "%s - no reply\n", ioc->name, __func__)); | 1177 | "%s - no reply\n", ioc->name, __func__)); |
@@ -1188,10 +1187,10 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1188 | 1187 | ||
1189 | unmap: | 1188 | unmap: |
1190 | if (dma_addr_out) | 1189 | if (dma_addr_out) |
1191 | pci_unmap_single(ioc->pdev, dma_addr_out, req->data_len, | 1190 | pci_unmap_single(ioc->pdev, dma_addr_out, blk_rq_bytes(req), |
1192 | PCI_DMA_BIDIRECTIONAL); | 1191 | PCI_DMA_BIDIRECTIONAL); |
1193 | if (dma_addr_in) | 1192 | if (dma_addr_in) |
1194 | pci_unmap_single(ioc->pdev, dma_addr_in, rsp->data_len, | 1193 | pci_unmap_single(ioc->pdev, dma_addr_in, blk_rq_bytes(rsp), |
1195 | PCI_DMA_BIDIRECTIONAL); | 1194 | PCI_DMA_BIDIRECTIONAL); |
1196 | 1195 | ||
1197 | out: | 1196 | out: |
@@ -1201,11 +1200,11 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1201 | } | 1200 | } |
1202 | 1201 | ||
1203 | struct sas_function_template mpt2sas_transport_functions = { | 1202 | struct sas_function_template mpt2sas_transport_functions = { |
1204 | .get_linkerrors = transport_get_linkerrors, | 1203 | .get_linkerrors = _transport_get_linkerrors, |
1205 | .get_enclosure_identifier = transport_get_enclosure_identifier, | 1204 | .get_enclosure_identifier = _transport_get_enclosure_identifier, |
1206 | .get_bay_identifier = transport_get_bay_identifier, | 1205 | .get_bay_identifier = _transport_get_bay_identifier, |
1207 | .phy_reset = transport_phy_reset, | 1206 | .phy_reset = _transport_phy_reset, |
1208 | .smp_handler = transport_smp_handler, | 1207 | .smp_handler = _transport_smp_handler, |
1209 | }; | 1208 | }; |
1210 | 1209 | ||
1211 | struct scsi_transport_template *mpt2sas_transport_template; | 1210 | struct scsi_transport_template *mpt2sas_transport_template; |