diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_scsih.c')
| -rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 363 |
1 files changed, 294 insertions, 69 deletions
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); |
