diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2012-01-19 15:00:59 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 09:08:55 -0500 |
commit | f79cfec6b1906ab10ef70dccd601db25c97bae17 (patch) | |
tree | 8b6bb2112a5630a2b3468ecc29284070afd94102 /drivers | |
parent | b705690d8d16f7081be3637c0bda2a681f02ecf4 (diff) |
[SCSI] hpsa: factor out driver name
Sometimes, for testing purposes (e.g. testing rmmod on a system
that normally boots using hpsa) it's nice to rename the driver
and split it into two drivers and restrict it to certain
controllers. This makes that easier.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/hpsa.c | 27 | ||||
-rw-r--r-- | drivers/scsi/hpsa.h | 2 |
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 68df3da78782..d048b69962ea 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -56,6 +56,7 @@ | |||
56 | /* HPSA_DRIVER_VERSION must be 3 byte values (0-255) separated by '.' */ | 56 | /* HPSA_DRIVER_VERSION must be 3 byte values (0-255) separated by '.' */ |
57 | #define HPSA_DRIVER_VERSION "2.0.2-1" | 57 | #define HPSA_DRIVER_VERSION "2.0.2-1" |
58 | #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")" | 58 | #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")" |
59 | #define HPSA "hpsa" | ||
59 | 60 | ||
60 | /* How long to wait (in milliseconds) for board to go into simple mode */ | 61 | /* How long to wait (in milliseconds) for board to go into simple mode */ |
61 | #define MAX_CONFIG_WAIT 30000 | 62 | #define MAX_CONFIG_WAIT 30000 |
@@ -202,30 +203,30 @@ static int check_for_unit_attention(struct ctlr_info *h, | |||
202 | 203 | ||
203 | switch (c->err_info->SenseInfo[12]) { | 204 | switch (c->err_info->SenseInfo[12]) { |
204 | case STATE_CHANGED: | 205 | case STATE_CHANGED: |
205 | dev_warn(&h->pdev->dev, "hpsa%d: a state change " | 206 | dev_warn(&h->pdev->dev, HPSA "%d: a state change " |
206 | "detected, command retried\n", h->ctlr); | 207 | "detected, command retried\n", h->ctlr); |
207 | break; | 208 | break; |
208 | case LUN_FAILED: | 209 | case LUN_FAILED: |
209 | dev_warn(&h->pdev->dev, "hpsa%d: LUN failure " | 210 | dev_warn(&h->pdev->dev, HPSA "%d: LUN failure " |
210 | "detected, action required\n", h->ctlr); | 211 | "detected, action required\n", h->ctlr); |
211 | break; | 212 | break; |
212 | case REPORT_LUNS_CHANGED: | 213 | case REPORT_LUNS_CHANGED: |
213 | dev_warn(&h->pdev->dev, "hpsa%d: report LUN data " | 214 | dev_warn(&h->pdev->dev, HPSA "%d: report LUN data " |
214 | "changed, action required\n", h->ctlr); | 215 | "changed, action required\n", h->ctlr); |
215 | /* | 216 | /* |
216 | * Note: this REPORT_LUNS_CHANGED condition only occurs on the MSA2012. | 217 | * Note: this REPORT_LUNS_CHANGED condition only occurs on the MSA2012. |
217 | */ | 218 | */ |
218 | break; | 219 | break; |
219 | case POWER_OR_RESET: | 220 | case POWER_OR_RESET: |
220 | dev_warn(&h->pdev->dev, "hpsa%d: a power on " | 221 | dev_warn(&h->pdev->dev, HPSA "%d: a power on " |
221 | "or device reset detected\n", h->ctlr); | 222 | "or device reset detected\n", h->ctlr); |
222 | break; | 223 | break; |
223 | case UNIT_ATTENTION_CLEARED: | 224 | case UNIT_ATTENTION_CLEARED: |
224 | dev_warn(&h->pdev->dev, "hpsa%d: unit attention " | 225 | dev_warn(&h->pdev->dev, HPSA "%d: unit attention " |
225 | "cleared by another initiator\n", h->ctlr); | 226 | "cleared by another initiator\n", h->ctlr); |
226 | break; | 227 | break; |
227 | default: | 228 | default: |
228 | dev_warn(&h->pdev->dev, "hpsa%d: unknown " | 229 | dev_warn(&h->pdev->dev, HPSA "%d: unknown " |
229 | "unit attention detected\n", h->ctlr); | 230 | "unit attention detected\n", h->ctlr); |
230 | break; | 231 | break; |
231 | } | 232 | } |
@@ -475,8 +476,8 @@ static struct device_attribute *hpsa_shost_attrs[] = { | |||
475 | 476 | ||
476 | static struct scsi_host_template hpsa_driver_template = { | 477 | static struct scsi_host_template hpsa_driver_template = { |
477 | .module = THIS_MODULE, | 478 | .module = THIS_MODULE, |
478 | .name = "hpsa", | 479 | .name = HPSA, |
479 | .proc_name = "hpsa", | 480 | .proc_name = HPSA, |
480 | .queuecommand = hpsa_scsi_queue_command, | 481 | .queuecommand = hpsa_scsi_queue_command, |
481 | .scan_start = hpsa_scan_start, | 482 | .scan_start = hpsa_scan_start, |
482 | .scan_finished = hpsa_scan_finished, | 483 | .scan_finished = hpsa_scan_finished, |
@@ -3343,7 +3344,7 @@ static int hpsa_controller_hard_reset(struct pci_dev *pdev, | |||
3343 | static __devinit void init_driver_version(char *driver_version, int len) | 3344 | static __devinit void init_driver_version(char *driver_version, int len) |
3344 | { | 3345 | { |
3345 | memset(driver_version, 0, len); | 3346 | memset(driver_version, 0, len); |
3346 | strncpy(driver_version, "hpsa " HPSA_DRIVER_VERSION, len - 1); | 3347 | strncpy(driver_version, HPSA " " HPSA_DRIVER_VERSION, len - 1); |
3347 | } | 3348 | } |
3348 | 3349 | ||
3349 | static __devinit int write_driver_ver_to_cfgtable( | 3350 | static __devinit int write_driver_ver_to_cfgtable( |
@@ -3924,7 +3925,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h) | |||
3924 | return err; | 3925 | return err; |
3925 | } | 3926 | } |
3926 | 3927 | ||
3927 | err = pci_request_regions(h->pdev, "hpsa"); | 3928 | err = pci_request_regions(h->pdev, HPSA); |
3928 | if (err) { | 3929 | if (err) { |
3929 | dev_err(&h->pdev->dev, | 3930 | dev_err(&h->pdev->dev, |
3930 | "cannot obtain PCI resources, aborting\n"); | 3931 | "cannot obtain PCI resources, aborting\n"); |
@@ -4242,7 +4243,7 @@ static void start_controller_lockup_detector(struct ctlr_info *h) | |||
4242 | spin_lock_init(&lockup_detector_lock); | 4243 | spin_lock_init(&lockup_detector_lock); |
4243 | hpsa_lockup_detector = | 4244 | hpsa_lockup_detector = |
4244 | kthread_run(detect_controller_lockup_thread, | 4245 | kthread_run(detect_controller_lockup_thread, |
4245 | NULL, "hpsa"); | 4246 | NULL, HPSA); |
4246 | } | 4247 | } |
4247 | if (!hpsa_lockup_detector) { | 4248 | if (!hpsa_lockup_detector) { |
4248 | dev_warn(&h->pdev->dev, | 4249 | dev_warn(&h->pdev->dev, |
@@ -4314,7 +4315,7 @@ reinit_after_soft_reset: | |||
4314 | if (rc != 0) | 4315 | if (rc != 0) |
4315 | goto clean1; | 4316 | goto clean1; |
4316 | 4317 | ||
4317 | sprintf(h->devname, "hpsa%d", number_of_controllers); | 4318 | sprintf(h->devname, HPSA "%d", number_of_controllers); |
4318 | h->ctlr = number_of_controllers; | 4319 | h->ctlr = number_of_controllers; |
4319 | number_of_controllers++; | 4320 | number_of_controllers++; |
4320 | 4321 | ||
@@ -4528,7 +4529,7 @@ static int hpsa_resume(__attribute__((unused)) struct pci_dev *pdev) | |||
4528 | } | 4529 | } |
4529 | 4530 | ||
4530 | static struct pci_driver hpsa_pci_driver = { | 4531 | static struct pci_driver hpsa_pci_driver = { |
4531 | .name = "hpsa", | 4532 | .name = HPSA, |
4532 | .probe = hpsa_init_one, | 4533 | .probe = hpsa_init_one, |
4533 | .remove = __devexit_p(hpsa_remove_one), | 4534 | .remove = __devexit_p(hpsa_remove_one), |
4534 | .id_table = hpsa_pci_device_id, /* id_table */ | 4535 | .id_table = hpsa_pci_device_id, /* id_table */ |
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index b4b97ebcb47a..7b28d54fa878 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h | |||
@@ -316,7 +316,7 @@ static unsigned long SA5_completed(struct ctlr_info *h) | |||
316 | dev_dbg(&h->pdev->dev, "Read %lx back from board\n", | 316 | dev_dbg(&h->pdev->dev, "Read %lx back from board\n", |
317 | register_value); | 317 | register_value); |
318 | else | 318 | else |
319 | dev_dbg(&h->pdev->dev, "hpsa: FIFO Empty read\n"); | 319 | dev_dbg(&h->pdev->dev, "FIFO Empty read\n"); |
320 | #endif | 320 | #endif |
321 | 321 | ||
322 | return register_value; | 322 | return register_value; |