aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreekanth Reddy <sreekanth.reddy@avagotech.com>2015-11-11 07:00:18 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2015-11-11 18:17:07 -0500
commit8a7e4c24e08fceb94887eb6d8123d6059dc5ddcd (patch)
tree489b799635f1b55788b1831a12dab0ce28164b46
parent3c5866565f37d45e3b812e3045caf2358f2f2377 (diff)
mpt3sas: Added mpt2sas driver definitions
1. Added mpt2sas driver related macros in mpt3sas header files 2. Made scsi host's, raid class', pci's, ioctl's callback functions global so that both drivers can use them. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Acked-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c8
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.h58
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c40
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c230
4 files changed, 191 insertions, 145 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index d4f1dcdb8361..302f02afd2a1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2855,15 +2855,15 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
2855 else 2855 else
2856 sg_tablesize = MPT3SAS_SG_DEPTH; 2856 sg_tablesize = MPT3SAS_SG_DEPTH;
2857 2857
2858 if (sg_tablesize < MPT3SAS_MIN_PHYS_SEGMENTS) 2858 if (sg_tablesize < MPT_MIN_PHYS_SEGMENTS)
2859 sg_tablesize = MPT3SAS_MIN_PHYS_SEGMENTS; 2859 sg_tablesize = MPT_MIN_PHYS_SEGMENTS;
2860 else if (sg_tablesize > MPT3SAS_MAX_PHYS_SEGMENTS) { 2860 else if (sg_tablesize > MPT_MAX_PHYS_SEGMENTS) {
2861 sg_tablesize = min_t(unsigned short, sg_tablesize, 2861 sg_tablesize = min_t(unsigned short, sg_tablesize,
2862 SCSI_MAX_SG_CHAIN_SEGMENTS); 2862 SCSI_MAX_SG_CHAIN_SEGMENTS);
2863 pr_warn(MPT3SAS_FMT 2863 pr_warn(MPT3SAS_FMT
2864 "sg_tablesize(%u) is bigger than kernel" 2864 "sg_tablesize(%u) is bigger than kernel"
2865 " defined SCSI_MAX_SG_SEGMENTS(%u)\n", ioc->name, 2865 " defined SCSI_MAX_SG_SEGMENTS(%u)\n", ioc->name,
2866 sg_tablesize, MPT3SAS_MAX_PHYS_SEGMENTS); 2866 sg_tablesize, MPT_MAX_PHYS_SEGMENTS);
2867 } 2867 }
2868 ioc->shost->sg_tablesize = sg_tablesize; 2868 ioc->shost->sg_tablesize = sg_tablesize;
2869 2869
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index f0e462b0880d..699cf720b51b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -63,15 +63,20 @@
63#include <scsi/scsi_transport_sas.h> 63#include <scsi/scsi_transport_sas.h>
64#include <scsi/scsi_dbg.h> 64#include <scsi/scsi_dbg.h>
65#include <scsi/scsi_eh.h> 65#include <scsi/scsi_eh.h>
66#include <linux/pci.h>
67#include <linux/poll.h>
66 68
67#include "mpt3sas_debug.h" 69#include "mpt3sas_debug.h"
68#include "mpt3sas_trigger_diag.h" 70#include "mpt3sas_trigger_diag.h"
69 71
70/* driver versioning info */ 72/* driver versioning info */
71#define MPT3SAS_DRIVER_NAME "mpt3sas" 73#define MPT3SAS_DRIVER_NAME "mpt3sas"
74#define MPT2SAS_DRIVER_NAME "mpt2sas"
72#define MPT3SAS_AUTHOR "Avago Technologies <MPT-FusionLinux.pdl@avagotech.com>" 75#define MPT3SAS_AUTHOR "Avago Technologies <MPT-FusionLinux.pdl@avagotech.com>"
73#define MPT3SAS_DESCRIPTION "LSI MPT Fusion SAS 3.0 Device Driver" 76#define MPT3SAS_DESCRIPTION "LSI MPT Fusion SAS 3.0 Device Driver"
77#define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver"
74#define MPT3SAS_DRIVER_VERSION "09.100.00.00" 78#define MPT3SAS_DRIVER_VERSION "09.100.00.00"
79#define MPT2SAS_DRIVER_VERSION "20.101.00.00"
75#define MPT3SAS_MAJOR_VERSION 9 80#define MPT3SAS_MAJOR_VERSION 9
76#define MPT3SAS_MINOR_VERSION 100 81#define MPT3SAS_MINOR_VERSION 100
77#define MPT3SAS_BUILD_VERSION 0 82#define MPT3SAS_BUILD_VERSION 0
@@ -80,14 +85,20 @@
80/* 85/*
81 * Set MPT3SAS_SG_DEPTH value based on user input. 86 * Set MPT3SAS_SG_DEPTH value based on user input.
82 */ 87 */
83#define MPT3SAS_MAX_PHYS_SEGMENTS SCSI_MAX_SG_SEGMENTS 88#define MPT_MAX_PHYS_SEGMENTS SCSI_MAX_SG_SEGMENTS
84#define MPT3SAS_MIN_PHYS_SEGMENTS 16 89#define MPT_MIN_PHYS_SEGMENTS 16
90
85#ifdef CONFIG_SCSI_MPT3SAS_MAX_SGE 91#ifdef CONFIG_SCSI_MPT3SAS_MAX_SGE
86#define MPT3SAS_SG_DEPTH CONFIG_SCSI_MPT3SAS_MAX_SGE 92#define MPT3SAS_SG_DEPTH CONFIG_SCSI_MPT3SAS_MAX_SGE
87#else 93#else
88#define MPT3SAS_SG_DEPTH MPT3SAS_MAX_PHYS_SEGMENTS 94#define MPT3SAS_SG_DEPTH MPT_MAX_PHYS_SEGMENTS
89#endif 95#endif
90 96
97#ifdef CONFIG_SCSI_MPT2SAS_MAX_SGE
98#define MPT2SAS_SG_DEPTH CONFIG_SCSI_MPT2SAS_MAX_SGE
99#else
100#define MPT2SAS_SG_DEPTH MPT_MAX_PHYS_SEGMENTS
101#endif
91 102
92/* 103/*
93 * Generic Defines 104 * Generic Defines
@@ -1095,6 +1106,39 @@ struct _sas_device *mpt3sas_scsih_sas_device_find_by_sas_address(
1095 1106
1096void mpt3sas_port_enable_complete(struct MPT3SAS_ADAPTER *ioc); 1107void mpt3sas_port_enable_complete(struct MPT3SAS_ADAPTER *ioc);
1097 1108
1109void scsih_exit(void);
1110int scsih_init(void);
1111int scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id);
1112void scsih_remove(struct pci_dev *pdev);
1113void scsih_shutdown(struct pci_dev *pdev);
1114pci_ers_result_t scsih_pci_error_detected(struct pci_dev *pdev,
1115 pci_channel_state_t state);
1116pci_ers_result_t scsih_pci_mmio_enabled(struct pci_dev *pdev);
1117pci_ers_result_t scsih_pci_slot_reset(struct pci_dev *pdev);
1118void scsih_pci_resume(struct pci_dev *pdev);
1119int scsih_suspend(struct pci_dev *pdev, pm_message_t state);
1120int scsih_resume(struct pci_dev *pdev);
1121
1122int scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd);
1123int scsih_target_alloc(struct scsi_target *starget);
1124int scsih_slave_alloc(struct scsi_device *sdev);
1125int scsih_slave_configure(struct scsi_device *sdev);
1126void scsih_target_destroy(struct scsi_target *starget);
1127void scsih_slave_destroy(struct scsi_device *sdev);
1128int scsih_scan_finished(struct Scsi_Host *shost, unsigned long time);
1129void scsih_scan_start(struct Scsi_Host *shost);
1130int scsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
1131int scsih_abort(struct scsi_cmnd *scmd);
1132int scsih_dev_reset(struct scsi_cmnd *scmd);
1133int scsih_target_reset(struct scsi_cmnd *scmd);
1134int scsih_host_reset(struct scsi_cmnd *scmd);
1135int scsih_bios_param(struct scsi_device *sdev, struct block_device *bdev,
1136 sector_t capacity, int params[]);
1137
1138int scsih_is_raid(struct device *dev);
1139void scsih_get_resync(struct device *dev);
1140void scsih_get_state(struct device *dev);
1141
1098/* config shared API */ 1142/* config shared API */
1099u8 mpt3sas_config_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 1143u8 mpt3sas_config_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
1100 u32 reply); 1144 u32 reply);
@@ -1177,8 +1221,12 @@ int mpt3sas_config_get_volume_wwid(struct MPT3SAS_ADAPTER *ioc,
1177/* ctl shared API */ 1221/* ctl shared API */
1178extern struct device_attribute *mpt3sas_host_attrs[]; 1222extern struct device_attribute *mpt3sas_host_attrs[];
1179extern struct device_attribute *mpt3sas_dev_attrs[]; 1223extern struct device_attribute *mpt3sas_dev_attrs[];
1180void mpt3sas_ctl_init(void); 1224long ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1181void mpt3sas_ctl_exit(void); 1225unsigned int ctl_poll(struct file *filep, poll_table *wait);
1226int ctl_fasync(int fd, struct file *filep, int mode);
1227long ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg);
1228void ctl_init(void);
1229void ctl_exit(void);
1182u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 1230u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
1183 u32 reply); 1231 u32 reply);
1184void mpt3sas_ctl_reset_handler(struct MPT3SAS_ADAPTER *ioc, int reset_phase); 1232void mpt3sas_ctl_reset_handler(struct MPT3SAS_ADAPTER *ioc, int reset_phase);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index 080c8a76d23d..e72a16c02eaf 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -490,27 +490,27 @@ mpt3sas_ctl_reset_handler(struct MPT3SAS_ADAPTER *ioc, int reset_phase)
490} 490}
491 491
492/** 492/**
493 * _ctl_fasync - 493 * ctl_fasync -
494 * @fd - 494 * @fd -
495 * @filep - 495 * @filep -
496 * @mode - 496 * @mode -
497 * 497 *
498 * Called when application request fasyn callback handler. 498 * Called when application request fasyn callback handler.
499 */ 499 */
500static int 500int
501_ctl_fasync(int fd, struct file *filep, int mode) 501ctl_fasync(int fd, struct file *filep, int mode)
502{ 502{
503 return fasync_helper(fd, filep, mode, &async_queue); 503 return fasync_helper(fd, filep, mode, &async_queue);
504} 504}
505 505
506/** 506/**
507 * _ctl_poll - 507 * ctl_poll -
508 * @file - 508 * @file -
509 * @wait - 509 * @wait -
510 * 510 *
511 */ 511 */
512static unsigned int 512unsigned int
513_ctl_poll(struct file *filep, poll_table *wait) 513ctl_poll(struct file *filep, poll_table *wait)
514{ 514{
515 struct MPT3SAS_ADAPTER *ioc; 515 struct MPT3SAS_ADAPTER *ioc;
516 516
@@ -2298,13 +2298,13 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg,
2298} 2298}
2299 2299
2300/** 2300/**
2301 * _ctl_ioctl - main ioctl entry point (unlocked) 2301 * ctl_ioctl - main ioctl entry point (unlocked)
2302 * @file - (struct file) 2302 * @file - (struct file)
2303 * @cmd - ioctl opcode 2303 * @cmd - ioctl opcode
2304 * @arg - 2304 * @arg -
2305 */ 2305 */
2306static long 2306long
2307_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 2307ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2308{ 2308{
2309 long ret; 2309 long ret;
2310 2310
@@ -2314,15 +2314,15 @@ _ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2314 2314
2315#ifdef CONFIG_COMPAT 2315#ifdef CONFIG_COMPAT
2316/** 2316/**
2317 * _ctl_ioctl_compat - main ioctl entry point (compat) 2317 * ctl_ioctl_compat - main ioctl entry point (compat)
2318 * @file - 2318 * @file -
2319 * @cmd - 2319 * @cmd -
2320 * @arg - 2320 * @arg -
2321 * 2321 *
2322 * This routine handles 32 bit applications in 64bit os. 2322 * This routine handles 32 bit applications in 64bit os.
2323 */ 2323 */
2324static long 2324long
2325_ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg) 2325ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg)
2326{ 2326{
2327 long ret; 2327 long ret;
2328 2328
@@ -3220,11 +3220,11 @@ struct device_attribute *mpt3sas_dev_attrs[] = {
3220 3220
3221static const struct file_operations ctl_fops = { 3221static const struct file_operations ctl_fops = {
3222 .owner = THIS_MODULE, 3222 .owner = THIS_MODULE,
3223 .unlocked_ioctl = _ctl_ioctl, 3223 .unlocked_ioctl = ctl_ioctl,
3224 .poll = _ctl_poll, 3224 .poll = ctl_poll,
3225 .fasync = _ctl_fasync, 3225 .fasync = ctl_fasync,
3226#ifdef CONFIG_COMPAT 3226#ifdef CONFIG_COMPAT
3227 .compat_ioctl = _ctl_ioctl_compat, 3227 .compat_ioctl = ctl_ioctl_compat,
3228#endif 3228#endif
3229}; 3229};
3230 3230
@@ -3235,11 +3235,11 @@ static struct miscdevice ctl_dev = {
3235}; 3235};
3236 3236
3237/** 3237/**
3238 * mpt3sas_ctl_init - main entry point for ctl. 3238 * ctl_init - main entry point for ctl.
3239 * 3239 *
3240 */ 3240 */
3241void 3241void
3242mpt3sas_ctl_init(void) 3242ctl_init(void)
3243{ 3243{
3244 async_queue = NULL; 3244 async_queue = NULL;
3245 if (misc_register(&ctl_dev) < 0) 3245 if (misc_register(&ctl_dev) < 0)
@@ -3250,11 +3250,11 @@ mpt3sas_ctl_init(void)
3250} 3250}
3251 3251
3252/** 3252/**
3253 * mpt3sas_ctl_exit - exit point for ctl 3253 * ctl_exit - exit point for ctl
3254 * 3254 *
3255 */ 3255 */
3256void 3256void
3257mpt3sas_ctl_exit(void) 3257ctl_exit(void)
3258{ 3258{
3259 struct MPT3SAS_ADAPTER *ioc; 3259 struct MPT3SAS_ADAPTER *ioc;
3260 int i; 3260 int i;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 8ccef38523fa..3353b487ab70 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -75,8 +75,6 @@ static int _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle,
75 75
76static u8 _scsih_check_for_pending_tm(struct MPT3SAS_ADAPTER *ioc, u16 smid); 76static u8 _scsih_check_for_pending_tm(struct MPT3SAS_ADAPTER *ioc, u16 smid);
77 77
78static void _scsih_scan_start(struct Scsi_Host *shost);
79static int _scsih_scan_finished(struct Scsi_Host *shost, unsigned long time);
80 78
81/* global parameters */ 79/* global parameters */
82LIST_HEAD(mpt3sas_ioc_list); 80LIST_HEAD(mpt3sas_ioc_list);
@@ -1095,14 +1093,14 @@ _scsih_scsi_lookup_find_by_lun(struct MPT3SAS_ADAPTER *ioc, int id,
1095} 1093}
1096 1094
1097/** 1095/**
1098 * _scsih_change_queue_depth - setting device queue depth 1096 * scsih_change_queue_depth - setting device queue depth
1099 * @sdev: scsi device struct 1097 * @sdev: scsi device struct
1100 * @qdepth: requested queue depth 1098 * @qdepth: requested queue depth
1101 * 1099 *
1102 * Returns queue depth. 1100 * Returns queue depth.
1103 */ 1101 */
1104static int 1102int
1105_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) 1103scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
1106{ 1104{
1107 struct Scsi_Host *shost = sdev->host; 1105 struct Scsi_Host *shost = sdev->host;
1108 int max_depth; 1106 int max_depth;
@@ -1141,14 +1139,14 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
1141} 1139}
1142 1140
1143/** 1141/**
1144 * _scsih_target_alloc - target add routine 1142 * scsih_target_alloc - target add routine
1145 * @starget: scsi target struct 1143 * @starget: scsi target struct
1146 * 1144 *
1147 * Returns 0 if ok. Any other return is assumed to be an error and 1145 * Returns 0 if ok. Any other return is assumed to be an error and
1148 * the device is ignored. 1146 * the device is ignored.
1149 */ 1147 */
1150static int 1148int
1151_scsih_target_alloc(struct scsi_target *starget) 1149scsih_target_alloc(struct scsi_target *starget)
1152{ 1150{
1153 struct Scsi_Host *shost = dev_to_shost(&starget->dev); 1151 struct Scsi_Host *shost = dev_to_shost(&starget->dev);
1154 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 1152 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -1206,13 +1204,13 @@ _scsih_target_alloc(struct scsi_target *starget)
1206} 1204}
1207 1205
1208/** 1206/**
1209 * _scsih_target_destroy - target destroy routine 1207 * scsih_target_destroy - target destroy routine
1210 * @starget: scsi target struct 1208 * @starget: scsi target struct
1211 * 1209 *
1212 * Returns nothing. 1210 * Returns nothing.
1213 */ 1211 */
1214static void 1212void
1215_scsih_target_destroy(struct scsi_target *starget) 1213scsih_target_destroy(struct scsi_target *starget)
1216{ 1214{
1217 struct Scsi_Host *shost = dev_to_shost(&starget->dev); 1215 struct Scsi_Host *shost = dev_to_shost(&starget->dev);
1218 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 1216 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -1255,14 +1253,14 @@ _scsih_target_destroy(struct scsi_target *starget)
1255} 1253}
1256 1254
1257/** 1255/**
1258 * _scsih_slave_alloc - device add routine 1256 * scsih_slave_alloc - device add routine
1259 * @sdev: scsi device struct 1257 * @sdev: scsi device struct
1260 * 1258 *
1261 * Returns 0 if ok. Any other return is assumed to be an error and 1259 * Returns 0 if ok. Any other return is assumed to be an error and
1262 * the device is ignored. 1260 * the device is ignored.
1263 */ 1261 */
1264static int 1262int
1265_scsih_slave_alloc(struct scsi_device *sdev) 1263scsih_slave_alloc(struct scsi_device *sdev)
1266{ 1264{
1267 struct Scsi_Host *shost; 1265 struct Scsi_Host *shost;
1268 struct MPT3SAS_ADAPTER *ioc; 1266 struct MPT3SAS_ADAPTER *ioc;
@@ -1317,13 +1315,13 @@ _scsih_slave_alloc(struct scsi_device *sdev)
1317} 1315}
1318 1316
1319/** 1317/**
1320 * _scsih_slave_destroy - device destroy routine 1318 * scsih_slave_destroy - device destroy routine
1321 * @sdev: scsi device struct 1319 * @sdev: scsi device struct
1322 * 1320 *
1323 * Returns nothing. 1321 * Returns nothing.
1324 */ 1322 */
1325static void 1323void
1326_scsih_slave_destroy(struct scsi_device *sdev) 1324scsih_slave_destroy(struct scsi_device *sdev)
1327{ 1325{
1328 struct MPT3SAS_TARGET *sas_target_priv_data; 1326 struct MPT3SAS_TARGET *sas_target_priv_data;
1329 struct scsi_target *starget; 1327 struct scsi_target *starget;
@@ -1409,11 +1407,11 @@ _scsih_display_sata_capabilities(struct MPT3SAS_ADAPTER *ioc,
1409 */ 1407 */
1410 1408
1411/** 1409/**
1412 * _scsih_is_raid - return boolean indicating device is raid volume 1410 * scsih_is_raid - return boolean indicating device is raid volume
1413 * @dev the device struct object 1411 * @dev the device struct object
1414 */ 1412 */
1415static int 1413int
1416_scsih_is_raid(struct device *dev) 1414scsih_is_raid(struct device *dev)
1417{ 1415{
1418 struct scsi_device *sdev = to_scsi_device(dev); 1416 struct scsi_device *sdev = to_scsi_device(dev);
1419 1417
@@ -1421,11 +1419,11 @@ _scsih_is_raid(struct device *dev)
1421} 1419}
1422 1420
1423/** 1421/**
1424 * _scsih_get_resync - get raid volume resync percent complete 1422 * scsih_get_resync - get raid volume resync percent complete
1425 * @dev the device struct object 1423 * @dev the device struct object
1426 */ 1424 */
1427static void 1425void
1428_scsih_get_resync(struct device *dev) 1426scsih_get_resync(struct device *dev)
1429{ 1427{
1430 struct scsi_device *sdev = to_scsi_device(dev); 1428 struct scsi_device *sdev = to_scsi_device(dev);
1431 struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host); 1429 struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host);
@@ -1470,11 +1468,11 @@ _scsih_get_resync(struct device *dev)
1470} 1468}
1471 1469
1472/** 1470/**
1473 * _scsih_get_state - get raid volume level 1471 * scsih_get_state - get raid volume level
1474 * @dev the device struct object 1472 * @dev the device struct object
1475 */ 1473 */
1476static void 1474void
1477_scsih_get_state(struct device *dev) 1475scsih_get_state(struct device *dev)
1478{ 1476{
1479 struct scsi_device *sdev = to_scsi_device(dev); 1477 struct scsi_device *sdev = to_scsi_device(dev);
1480 struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host); 1478 struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host);
@@ -1652,14 +1650,14 @@ _scsih_enable_tlr(struct MPT3SAS_ADAPTER *ioc, struct scsi_device *sdev)
1652} 1650}
1653 1651
1654/** 1652/**
1655 * _scsih_slave_configure - device configure routine. 1653 * scsih_slave_configure - device configure routine.
1656 * @sdev: scsi device struct 1654 * @sdev: scsi device struct
1657 * 1655 *
1658 * Returns 0 if ok. Any other return is assumed to be an error and 1656 * Returns 0 if ok. Any other return is assumed to be an error and
1659 * the device is ignored. 1657 * the device is ignored.
1660 */ 1658 */
1661static int 1659int
1662_scsih_slave_configure(struct scsi_device *sdev) 1660scsih_slave_configure(struct scsi_device *sdev)
1663{ 1661{
1664 struct Scsi_Host *shost = sdev->host; 1662 struct Scsi_Host *shost = sdev->host;
1665 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 1663 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -1757,7 +1755,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
1757 raid_device->num_pds, ds); 1755 raid_device->num_pds, ds);
1758 1756
1759 1757
1760 _scsih_change_queue_depth(sdev, qdepth); 1758 scsih_change_queue_depth(sdev, qdepth);
1761 1759
1762/* raid transport support */ 1760/* raid transport support */
1763 _scsih_set_level(sdev, raid_device->volume_type); 1761 _scsih_set_level(sdev, raid_device->volume_type);
@@ -1829,7 +1827,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
1829 _scsih_display_sata_capabilities(ioc, handle, sdev); 1827 _scsih_display_sata_capabilities(ioc, handle, sdev);
1830 1828
1831 1829
1832 _scsih_change_queue_depth(sdev, qdepth); 1830 scsih_change_queue_depth(sdev, qdepth);
1833 1831
1834 if (ssp_target) { 1832 if (ssp_target) {
1835 sas_read_port_mode_page(sdev); 1833 sas_read_port_mode_page(sdev);
@@ -1840,7 +1838,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
1840} 1838}
1841 1839
1842/** 1840/**
1843 * _scsih_bios_param - fetch head, sector, cylinder info for a disk 1841 * scsih_bios_param - fetch head, sector, cylinder info for a disk
1844 * @sdev: scsi device struct 1842 * @sdev: scsi device struct
1845 * @bdev: pointer to block device context 1843 * @bdev: pointer to block device context
1846 * @capacity: device size (in 512 byte sectors) 1844 * @capacity: device size (in 512 byte sectors)
@@ -1851,8 +1849,8 @@ _scsih_slave_configure(struct scsi_device *sdev)
1851 * 1849 *
1852 * Return nothing. 1850 * Return nothing.
1853 */ 1851 */
1854static int 1852int
1855_scsih_bios_param(struct scsi_device *sdev, struct block_device *bdev, 1853scsih_bios_param(struct scsi_device *sdev, struct block_device *bdev,
1856 sector_t capacity, int params[]) 1854 sector_t capacity, int params[])
1857{ 1855{
1858 int heads; 1856 int heads;
@@ -2252,13 +2250,13 @@ _scsih_tm_display_info(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd)
2252} 2250}
2253 2251
2254/** 2252/**
2255 * _scsih_abort - eh threads main abort routine 2253 * scsih_abort - eh threads main abort routine
2256 * @scmd: pointer to scsi command object 2254 * @scmd: pointer to scsi command object
2257 * 2255 *
2258 * Returns SUCCESS if command aborted else FAILED 2256 * Returns SUCCESS if command aborted else FAILED
2259 */ 2257 */
2260static int 2258int
2261_scsih_abort(struct scsi_cmnd *scmd) 2259scsih_abort(struct scsi_cmnd *scmd)
2262{ 2260{
2263 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 2261 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
2264 struct MPT3SAS_DEVICE *sas_device_priv_data; 2262 struct MPT3SAS_DEVICE *sas_device_priv_data;
@@ -2311,13 +2309,13 @@ _scsih_abort(struct scsi_cmnd *scmd)
2311} 2309}
2312 2310
2313/** 2311/**
2314 * _scsih_dev_reset - eh threads main device reset routine 2312 * scsih_dev_reset - eh threads main device reset routine
2315 * @scmd: pointer to scsi command object 2313 * @scmd: pointer to scsi command object
2316 * 2314 *
2317 * Returns SUCCESS if command aborted else FAILED 2315 * Returns SUCCESS if command aborted else FAILED
2318 */ 2316 */
2319static int 2317int
2320_scsih_dev_reset(struct scsi_cmnd *scmd) 2318scsih_dev_reset(struct scsi_cmnd *scmd)
2321{ 2319{
2322 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 2320 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
2323 struct MPT3SAS_DEVICE *sas_device_priv_data; 2321 struct MPT3SAS_DEVICE *sas_device_priv_data;
@@ -2370,13 +2368,13 @@ _scsih_dev_reset(struct scsi_cmnd *scmd)
2370} 2368}
2371 2369
2372/** 2370/**
2373 * _scsih_target_reset - eh threads main target reset routine 2371 * scsih_target_reset - eh threads main target reset routine
2374 * @scmd: pointer to scsi command object 2372 * @scmd: pointer to scsi command object
2375 * 2373 *
2376 * Returns SUCCESS if command aborted else FAILED 2374 * Returns SUCCESS if command aborted else FAILED
2377 */ 2375 */
2378static int 2376int
2379_scsih_target_reset(struct scsi_cmnd *scmd) 2377scsih_target_reset(struct scsi_cmnd *scmd)
2380{ 2378{
2381 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 2379 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
2382 struct MPT3SAS_DEVICE *sas_device_priv_data; 2380 struct MPT3SAS_DEVICE *sas_device_priv_data;
@@ -2431,13 +2429,13 @@ _scsih_target_reset(struct scsi_cmnd *scmd)
2431 2429
2432 2430
2433/** 2431/**
2434 * _scsih_host_reset - eh threads main host reset routine 2432 * scsih_host_reset - eh threads main host reset routine
2435 * @scmd: pointer to scsi command object 2433 * @scmd: pointer to scsi command object
2436 * 2434 *
2437 * Returns SUCCESS if command aborted else FAILED 2435 * Returns SUCCESS if command aborted else FAILED
2438 */ 2436 */
2439static int 2437int
2440_scsih_host_reset(struct scsi_cmnd *scmd) 2438scsih_host_reset(struct scsi_cmnd *scmd)
2441{ 2439{
2442 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 2440 struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
2443 int r, retval; 2441 int r, retval;
@@ -3635,7 +3633,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
3635 3633
3636 3634
3637/** 3635/**
3638 * _scsih_qcmd - main scsi request entry point 3636 * scsih_qcmd - main scsi request entry point
3639 * @scmd: pointer to scsi command object 3637 * @scmd: pointer to scsi command object
3640 * @done: function pointer to be invoked on completion 3638 * @done: function pointer to be invoked on completion
3641 * 3639 *
@@ -3645,8 +3643,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
3645 * SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or 3643 * SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or
3646 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full 3644 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
3647 */ 3645 */
3648static int 3646int
3649_scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) 3647scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
3650{ 3648{
3651 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 3649 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
3652 struct MPT3SAS_DEVICE *sas_device_priv_data; 3650 struct MPT3SAS_DEVICE *sas_device_priv_data;
@@ -7493,20 +7491,20 @@ static struct scsi_host_template scsih_driver_template = {
7493 .module = THIS_MODULE, 7491 .module = THIS_MODULE,
7494 .name = "Fusion MPT SAS Host", 7492 .name = "Fusion MPT SAS Host",
7495 .proc_name = MPT3SAS_DRIVER_NAME, 7493 .proc_name = MPT3SAS_DRIVER_NAME,
7496 .queuecommand = _scsih_qcmd, 7494 .queuecommand = scsih_qcmd,
7497 .target_alloc = _scsih_target_alloc, 7495 .target_alloc = scsih_target_alloc,
7498 .slave_alloc = _scsih_slave_alloc, 7496 .slave_alloc = scsih_slave_alloc,
7499 .slave_configure = _scsih_slave_configure, 7497 .slave_configure = scsih_slave_configure,
7500 .target_destroy = _scsih_target_destroy, 7498 .target_destroy = scsih_target_destroy,
7501 .slave_destroy = _scsih_slave_destroy, 7499 .slave_destroy = scsih_slave_destroy,
7502 .scan_finished = _scsih_scan_finished, 7500 .scan_finished = scsih_scan_finished,
7503 .scan_start = _scsih_scan_start, 7501 .scan_start = scsih_scan_start,
7504 .change_queue_depth = _scsih_change_queue_depth, 7502 .change_queue_depth = scsih_change_queue_depth,
7505 .eh_abort_handler = _scsih_abort, 7503 .eh_abort_handler = scsih_abort,
7506 .eh_device_reset_handler = _scsih_dev_reset, 7504 .eh_device_reset_handler = scsih_dev_reset,
7507 .eh_target_reset_handler = _scsih_target_reset, 7505 .eh_target_reset_handler = scsih_target_reset,
7508 .eh_host_reset_handler = _scsih_host_reset, 7506 .eh_host_reset_handler = scsih_host_reset,
7509 .bios_param = _scsih_bios_param, 7507 .bios_param = scsih_bios_param,
7510 .can_queue = 1, 7508 .can_queue = 1,
7511 .this_id = -1, 7509 .this_id = -1,
7512 .sg_tablesize = MPT3SAS_SG_DEPTH, 7510 .sg_tablesize = MPT3SAS_SG_DEPTH,
@@ -7638,13 +7636,13 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc)
7638} 7636}
7639 7637
7640/** 7638/**
7641 * _scsih_remove - detach and remove add host 7639 * scsih_remove - detach and remove add host
7642 * @pdev: PCI device struct 7640 * @pdev: PCI device struct
7643 * 7641 *
7644 * Routine called when unloading the driver. 7642 * Routine called when unloading the driver.
7645 * Return nothing. 7643 * Return nothing.
7646 */ 7644 */
7647static void _scsih_remove(struct pci_dev *pdev) 7645void scsih_remove(struct pci_dev *pdev)
7648{ 7646{
7649 struct Scsi_Host *shost = pci_get_drvdata(pdev); 7647 struct Scsi_Host *shost = pci_get_drvdata(pdev);
7650 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 7648 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -7710,13 +7708,13 @@ static void _scsih_remove(struct pci_dev *pdev)
7710} 7708}
7711 7709
7712/** 7710/**
7713 * _scsih_shutdown - routine call during system shutdown 7711 * scsih_shutdown - routine call during system shutdown
7714 * @pdev: PCI device struct 7712 * @pdev: PCI device struct
7715 * 7713 *
7716 * Return nothing. 7714 * Return nothing.
7717 */ 7715 */
7718static void 7716void
7719_scsih_shutdown(struct pci_dev *pdev) 7717scsih_shutdown(struct pci_dev *pdev)
7720{ 7718{
7721 struct Scsi_Host *shost = pci_get_drvdata(pdev); 7719 struct Scsi_Host *shost = pci_get_drvdata(pdev);
7722 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 7720 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -7908,15 +7906,15 @@ _scsih_probe_devices(struct MPT3SAS_ADAPTER *ioc)
7908} 7906}
7909 7907
7910/** 7908/**
7911 * _scsih_scan_start - scsi lld callback for .scan_start 7909 * scsih_scan_start - scsi lld callback for .scan_start
7912 * @shost: SCSI host pointer 7910 * @shost: SCSI host pointer
7913 * 7911 *
7914 * The shost has the ability to discover targets on its own instead 7912 * The shost has the ability to discover targets on its own instead
7915 * of scanning the entire bus. In our implemention, we will kick off 7913 * of scanning the entire bus. In our implemention, we will kick off
7916 * firmware discovery. 7914 * firmware discovery.
7917 */ 7915 */
7918static void 7916void
7919_scsih_scan_start(struct Scsi_Host *shost) 7917scsih_scan_start(struct Scsi_Host *shost)
7920{ 7918{
7921 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 7919 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
7922 int rc; 7920 int rc;
@@ -7934,7 +7932,7 @@ _scsih_scan_start(struct Scsi_Host *shost)
7934} 7932}
7935 7933
7936/** 7934/**
7937 * _scsih_scan_finished - scsi lld callback for .scan_finished 7935 * scsih_scan_finished - scsi lld callback for .scan_finished
7938 * @shost: SCSI host pointer 7936 * @shost: SCSI host pointer
7939 * @time: elapsed time of the scan in jiffies 7937 * @time: elapsed time of the scan in jiffies
7940 * 7938 *
@@ -7942,8 +7940,8 @@ _scsih_scan_start(struct Scsi_Host *shost)
7942 * scsi_host and the elapsed time of the scan in jiffies. In our implemention, 7940 * scsi_host and the elapsed time of the scan in jiffies. In our implemention,
7943 * we wait for firmware discovery to complete, then return 1. 7941 * we wait for firmware discovery to complete, then return 1.
7944 */ 7942 */
7945static int 7943int
7946_scsih_scan_finished(struct Scsi_Host *shost, unsigned long time) 7944scsih_scan_finished(struct Scsi_Host *shost, unsigned long time)
7947{ 7945{
7948 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 7946 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
7949 7947
@@ -7988,14 +7986,14 @@ _scsih_scan_finished(struct Scsi_Host *shost, unsigned long time)
7988} 7986}
7989 7987
7990/** 7988/**
7991 * _scsih_probe - attach and add scsi host 7989 * scsih_probe - attach and add scsi host
7992 * @pdev: PCI device struct 7990 * @pdev: PCI device struct
7993 * @id: pci device id 7991 * @id: pci device id
7994 * 7992 *
7995 * Returns 0 success, anything else error. 7993 * Returns 0 success, anything else error.
7996 */ 7994 */
7997static int 7995int
7998_scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) 7996scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
7999{ 7997{
8000 struct MPT3SAS_ADAPTER *ioc; 7998 struct MPT3SAS_ADAPTER *ioc;
8001 struct Scsi_Host *shost; 7999 struct Scsi_Host *shost;
@@ -8124,14 +8122,14 @@ out_add_shost_fail:
8124 8122
8125#ifdef CONFIG_PM 8123#ifdef CONFIG_PM
8126/** 8124/**
8127 * _scsih_suspend - power management suspend main entry point 8125 * scsih_suspend - power management suspend main entry point
8128 * @pdev: PCI device struct 8126 * @pdev: PCI device struct
8129 * @state: PM state change to (usually PCI_D3) 8127 * @state: PM state change to (usually PCI_D3)
8130 * 8128 *
8131 * Returns 0 success, anything else error. 8129 * Returns 0 success, anything else error.
8132 */ 8130 */
8133static int 8131int
8134_scsih_suspend(struct pci_dev *pdev, pm_message_t state) 8132scsih_suspend(struct pci_dev *pdev, pm_message_t state)
8135{ 8133{
8136 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8134 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8137 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8135 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8152,13 +8150,13 @@ _scsih_suspend(struct pci_dev *pdev, pm_message_t state)
8152} 8150}
8153 8151
8154/** 8152/**
8155 * _scsih_resume - power management resume main entry point 8153 * scsih_resume - power management resume main entry point
8156 * @pdev: PCI device struct 8154 * @pdev: PCI device struct
8157 * 8155 *
8158 * Returns 0 success, anything else error. 8156 * Returns 0 success, anything else error.
8159 */ 8157 */
8160static int 8158int
8161_scsih_resume(struct pci_dev *pdev) 8159scsih_resume(struct pci_dev *pdev)
8162{ 8160{
8163 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8161 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8164 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8162 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8185,7 +8183,7 @@ _scsih_resume(struct pci_dev *pdev)
8185#endif /* CONFIG_PM */ 8183#endif /* CONFIG_PM */
8186 8184
8187/** 8185/**
8188 * _scsih_pci_error_detected - Called when a PCI error is detected. 8186 * scsih_pci_error_detected - Called when a PCI error is detected.
8189 * @pdev: PCI device struct 8187 * @pdev: PCI device struct
8190 * @state: PCI channel state 8188 * @state: PCI channel state
8191 * 8189 *
@@ -8194,8 +8192,8 @@ _scsih_resume(struct pci_dev *pdev)
8194 * Return value: 8192 * Return value:
8195 * PCI_ERS_RESULT_NEED_RESET or PCI_ERS_RESULT_DISCONNECT 8193 * PCI_ERS_RESULT_NEED_RESET or PCI_ERS_RESULT_DISCONNECT
8196 */ 8194 */
8197static pci_ers_result_t 8195pci_ers_result_t
8198_scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) 8196scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
8199{ 8197{
8200 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8198 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8201 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8199 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8224,15 +8222,15 @@ _scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
8224} 8222}
8225 8223
8226/** 8224/**
8227 * _scsih_pci_slot_reset - Called when PCI slot has been reset. 8225 * scsih_pci_slot_reset - Called when PCI slot has been reset.
8228 * @pdev: PCI device struct 8226 * @pdev: PCI device struct
8229 * 8227 *
8230 * Description: This routine is called by the pci error recovery 8228 * Description: This routine is called by the pci error recovery
8231 * code after the PCI slot has been reset, just before we 8229 * code after the PCI slot has been reset, just before we
8232 * should resume normal operations. 8230 * should resume normal operations.
8233 */ 8231 */
8234static pci_ers_result_t 8232pci_ers_result_t
8235_scsih_pci_slot_reset(struct pci_dev *pdev) 8233scsih_pci_slot_reset(struct pci_dev *pdev)
8236{ 8234{
8237 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8235 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8238 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8236 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8261,15 +8259,15 @@ _scsih_pci_slot_reset(struct pci_dev *pdev)
8261} 8259}
8262 8260
8263/** 8261/**
8264 * _scsih_pci_resume() - resume normal ops after PCI reset 8262 * scsih_pci_resume() - resume normal ops after PCI reset
8265 * @pdev: pointer to PCI device 8263 * @pdev: pointer to PCI device
8266 * 8264 *
8267 * Called when the error recovery driver tells us that its 8265 * Called when the error recovery driver tells us that its
8268 * OK to resume normal operation. Use completion to allow 8266 * OK to resume normal operation. Use completion to allow
8269 * halted scsi ops to resume. 8267 * halted scsi ops to resume.
8270 */ 8268 */
8271static void 8269void
8272_scsih_pci_resume(struct pci_dev *pdev) 8270scsih_pci_resume(struct pci_dev *pdev)
8273{ 8271{
8274 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8272 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8275 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8273 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8282,11 +8280,11 @@ _scsih_pci_resume(struct pci_dev *pdev)
8282} 8280}
8283 8281
8284/** 8282/**
8285 * _scsih_pci_mmio_enabled - Enable MMIO and dump debug registers 8283 * scsih_pci_mmio_enabled - Enable MMIO and dump debug registers
8286 * @pdev: pointer to PCI device 8284 * @pdev: pointer to PCI device
8287 */ 8285 */
8288static pci_ers_result_t 8286pci_ers_result_t
8289_scsih_pci_mmio_enabled(struct pci_dev *pdev) 8287scsih_pci_mmio_enabled(struct pci_dev *pdev)
8290{ 8288{
8291 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8289 struct Scsi_Host *shost = pci_get_drvdata(pdev);
8292 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 8290 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8303,39 +8301,39 @@ _scsih_pci_mmio_enabled(struct pci_dev *pdev)
8303/* raid transport support */ 8301/* raid transport support */
8304static struct raid_function_template mpt3sas_raid_functions = { 8302static struct raid_function_template mpt3sas_raid_functions = {
8305 .cookie = &scsih_driver_template, 8303 .cookie = &scsih_driver_template,
8306 .is_raid = _scsih_is_raid, 8304 .is_raid = scsih_is_raid,
8307 .get_resync = _scsih_get_resync, 8305 .get_resync = scsih_get_resync,
8308 .get_state = _scsih_get_state, 8306 .get_state = scsih_get_state,
8309}; 8307};
8310 8308
8311static struct pci_error_handlers _scsih_err_handler = { 8309static struct pci_error_handlers _scsih_err_handler = {
8312 .error_detected = _scsih_pci_error_detected, 8310 .error_detected = scsih_pci_error_detected,
8313 .mmio_enabled = _scsih_pci_mmio_enabled, 8311 .mmio_enabled = scsih_pci_mmio_enabled,
8314 .slot_reset = _scsih_pci_slot_reset, 8312 .slot_reset = scsih_pci_slot_reset,
8315 .resume = _scsih_pci_resume, 8313 .resume = scsih_pci_resume,
8316}; 8314};
8317 8315
8318static struct pci_driver scsih_driver = { 8316static struct pci_driver scsih_driver = {
8319 .name = MPT3SAS_DRIVER_NAME, 8317 .name = MPT3SAS_DRIVER_NAME,
8320 .id_table = scsih_pci_table, 8318 .id_table = scsih_pci_table,
8321 .probe = _scsih_probe, 8319 .probe = scsih_probe,
8322 .remove = _scsih_remove, 8320 .remove = scsih_remove,
8323 .shutdown = _scsih_shutdown, 8321 .shutdown = scsih_shutdown,
8324 .err_handler = &_scsih_err_handler, 8322 .err_handler = &_scsih_err_handler,
8325#ifdef CONFIG_PM 8323#ifdef CONFIG_PM
8326 .suspend = _scsih_suspend, 8324 .suspend = scsih_suspend,
8327 .resume = _scsih_resume, 8325 .resume = scsih_resume,
8328#endif 8326#endif
8329}; 8327};
8330 8328
8331 8329
8332/** 8330/**
8333 * _scsih_init - main entry point for this driver. 8331 * scsih_init - main entry point for this driver.
8334 * 8332 *
8335 * Returns 0 success, anything else error. 8333 * Returns 0 success, anything else error.
8336 */ 8334 */
8337static int __init 8335int
8338_scsih_init(void) 8336scsih_init(void)
8339{ 8337{
8340 int error; 8338 int error;
8341 8339
@@ -8392,7 +8390,7 @@ _scsih_init(void)
8392 tm_sas_control_cb_idx = mpt3sas_base_register_callback_handler( 8390 tm_sas_control_cb_idx = mpt3sas_base_register_callback_handler(
8393 _scsih_sas_control_complete); 8391 _scsih_sas_control_complete);
8394 8392
8395 mpt3sas_ctl_init(); 8393 ctl_init();
8396 8394
8397 error = pci_register_driver(&scsih_driver); 8395 error = pci_register_driver(&scsih_driver);
8398 if (error) { 8396 if (error) {
@@ -8409,13 +8407,13 @@ _scsih_init(void)
8409 * 8407 *
8410 * Returns 0 success, anything else error. 8408 * Returns 0 success, anything else error.
8411 */ 8409 */
8412static void __exit 8410void
8413_scsih_exit(void) 8411scsih_exit(void)
8414{ 8412{
8415 pr_info("mpt3sas version %s unloading\n", 8413 pr_info("mpt3sas version %s unloading\n",
8416 MPT3SAS_DRIVER_VERSION); 8414 MPT3SAS_DRIVER_VERSION);
8417 8415
8418 mpt3sas_ctl_exit(); 8416 ctl_exit();
8419 8417
8420 pci_unregister_driver(&scsih_driver); 8418 pci_unregister_driver(&scsih_driver);
8421 8419
@@ -8438,5 +8436,5 @@ _scsih_exit(void)
8438 sas_release_transport(mpt3sas_transport_template); 8436 sas_release_transport(mpt3sas_transport_template);
8439} 8437}
8440 8438
8441module_init(_scsih_init); 8439module_init(scsih_init);
8442module_exit(_scsih_exit); 8440module_exit(scsih_exit);