diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 13:36:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 13:36:08 -0500 |
commit | d04baa157d1b35cbd27c87b4a13111d9675b61f3 (patch) | |
tree | c46966fbea1c34bed2bd38629ce948d5a088281c /drivers/scsi/device_handler | |
parent | 88266917b518e2ca954d85983470592aaaf82993 (diff) | |
parent | 5c41dc3a79150e93e5d050871a10b761be8281a1 (diff) |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
SCSI updates for post 3.2 merge window
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (67 commits)
[SCSI] lpfc 8.3.28: Update driver version to 8.3.28
[SCSI] lpfc 8.3.28: Add Loopback support for SLI4 adapters
[SCSI] lpfc 8.3.28: Critical Miscellaneous fixes
[SCSI] Lpfc 8.3.28: FC and SCSI Discovery Fixes
[SCSI] lpfc 8.3.28: Add support for ABTS failure handling
[SCSI] lpfc 8.3.28: SLI fixes and added SLI4 support
[SCSI] lpfc 8.3.28: Miscellaneous fixes in sysfs and mgmt interfaces
[SCSI] mpt2sas: Removed redundant calling of _scsih_probe_devices() from _scsih_probe
[SCSI] mac_scsi: Remove obsolete IRQ_FLG_* users
[SCSI] qla4xxx: Update driver version to 5.02.00-k10
[SCSI] qla4xxx: check for FW alive before calling chip_reset
[SCSI] qla4xxx: Fix qla4xxx_dump_buffer to dump buffer correctly
[SCSI] qla4xxx: Fix the IDC locking mechanism
[SCSI] qla4xxx: Wait for disable_acb before doing set_acb
[SCSI] qla4xxx: Don't recover adapter if device state is FAILED
[SCSI] qla4xxx: fix call trace on rmmod with ql4xdontresethba=1
[SCSI] qla4xxx: Fix CPU lockups when ql4xdontresethba set
[SCSI] qla4xxx: Perform context resets in case of context failures.
[SCSI] iscsi class: export pid of process that created
[SCSI] mpt2sas: Remove unused duplicate diag_buffer_enable param
...
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh.c | 58 | ||||
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_emc.c | 19 | ||||
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_hp_sw.c | 19 | ||||
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_rdac.c | 19 |
4 files changed, 57 insertions, 58 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c index 23149b9e297c..48e46f5b77cc 100644 --- a/drivers/scsi/device_handler/scsi_dh.c +++ b/drivers/scsi/device_handler/scsi_dh.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | static DEFINE_SPINLOCK(list_lock); | 29 | static DEFINE_SPINLOCK(list_lock); |
30 | static LIST_HEAD(scsi_dh_list); | 30 | static LIST_HEAD(scsi_dh_list); |
31 | static int scsi_dh_list_idx = 1; | ||
32 | 31 | ||
33 | static struct scsi_device_handler *get_device_handler(const char *name) | 32 | static struct scsi_device_handler *get_device_handler(const char *name) |
34 | { | 33 | { |
@@ -45,21 +44,6 @@ static struct scsi_device_handler *get_device_handler(const char *name) | |||
45 | return found; | 44 | return found; |
46 | } | 45 | } |
47 | 46 | ||
48 | static struct scsi_device_handler *get_device_handler_by_idx(int idx) | ||
49 | { | ||
50 | struct scsi_device_handler *tmp, *found = NULL; | ||
51 | |||
52 | spin_lock(&list_lock); | ||
53 | list_for_each_entry(tmp, &scsi_dh_list, list) { | ||
54 | if (tmp->idx == idx) { | ||
55 | found = tmp; | ||
56 | break; | ||
57 | } | ||
58 | } | ||
59 | spin_unlock(&list_lock); | ||
60 | return found; | ||
61 | } | ||
62 | |||
63 | /* | 47 | /* |
64 | * device_handler_match_function - Match a device handler to a device | 48 | * device_handler_match_function - Match a device handler to a device |
65 | * @sdev - SCSI device to be tested | 49 | * @sdev - SCSI device to be tested |
@@ -84,23 +68,6 @@ device_handler_match_function(struct scsi_device *sdev) | |||
84 | } | 68 | } |
85 | 69 | ||
86 | /* | 70 | /* |
87 | * device_handler_match_devlist - Match a device handler to a device | ||
88 | * @sdev - SCSI device to be tested | ||
89 | * | ||
90 | * Tests @sdev against all device_handler registered in the devlist. | ||
91 | * Returns the found device handler or NULL if not found. | ||
92 | */ | ||
93 | static struct scsi_device_handler * | ||
94 | device_handler_match_devlist(struct scsi_device *sdev) | ||
95 | { | ||
96 | int idx; | ||
97 | |||
98 | idx = scsi_get_device_flags_keyed(sdev, sdev->vendor, sdev->model, | ||
99 | SCSI_DEVINFO_DH); | ||
100 | return get_device_handler_by_idx(idx); | ||
101 | } | ||
102 | |||
103 | /* | ||
104 | * device_handler_match - Attach a device handler to a device | 71 | * device_handler_match - Attach a device handler to a device |
105 | * @scsi_dh - The device handler to match against or NULL | 72 | * @scsi_dh - The device handler to match against or NULL |
106 | * @sdev - SCSI device to be tested against @scsi_dh | 73 | * @sdev - SCSI device to be tested against @scsi_dh |
@@ -116,8 +83,6 @@ device_handler_match(struct scsi_device_handler *scsi_dh, | |||
116 | struct scsi_device_handler *found_dh; | 83 | struct scsi_device_handler *found_dh; |
117 | 84 | ||
118 | found_dh = device_handler_match_function(sdev); | 85 | found_dh = device_handler_match_function(sdev); |
119 | if (!found_dh) | ||
120 | found_dh = device_handler_match_devlist(sdev); | ||
121 | 86 | ||
122 | if (scsi_dh && found_dh != scsi_dh) | 87 | if (scsi_dh && found_dh != scsi_dh) |
123 | found_dh = NULL; | 88 | found_dh = NULL; |
@@ -361,25 +326,14 @@ static int scsi_dh_notifier_remove(struct device *dev, void *data) | |||
361 | */ | 326 | */ |
362 | int scsi_register_device_handler(struct scsi_device_handler *scsi_dh) | 327 | int scsi_register_device_handler(struct scsi_device_handler *scsi_dh) |
363 | { | 328 | { |
364 | int i; | ||
365 | 329 | ||
366 | if (get_device_handler(scsi_dh->name)) | 330 | if (get_device_handler(scsi_dh->name)) |
367 | return -EBUSY; | 331 | return -EBUSY; |
368 | 332 | ||
369 | spin_lock(&list_lock); | 333 | spin_lock(&list_lock); |
370 | scsi_dh->idx = scsi_dh_list_idx++; | ||
371 | list_add(&scsi_dh->list, &scsi_dh_list); | 334 | list_add(&scsi_dh->list, &scsi_dh_list); |
372 | spin_unlock(&list_lock); | 335 | spin_unlock(&list_lock); |
373 | 336 | ||
374 | for (i = 0; scsi_dh->devlist && scsi_dh->devlist[i].vendor; i++) { | ||
375 | scsi_dev_info_list_add_keyed(0, | ||
376 | scsi_dh->devlist[i].vendor, | ||
377 | scsi_dh->devlist[i].model, | ||
378 | NULL, | ||
379 | scsi_dh->idx, | ||
380 | SCSI_DEVINFO_DH); | ||
381 | } | ||
382 | |||
383 | bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, scsi_dh_notifier_add); | 337 | bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, scsi_dh_notifier_add); |
384 | printk(KERN_INFO "%s: device handler registered\n", scsi_dh->name); | 338 | printk(KERN_INFO "%s: device handler registered\n", scsi_dh->name); |
385 | 339 | ||
@@ -396,7 +350,6 @@ EXPORT_SYMBOL_GPL(scsi_register_device_handler); | |||
396 | */ | 350 | */ |
397 | int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh) | 351 | int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh) |
398 | { | 352 | { |
399 | int i; | ||
400 | 353 | ||
401 | if (!get_device_handler(scsi_dh->name)) | 354 | if (!get_device_handler(scsi_dh->name)) |
402 | return -ENODEV; | 355 | return -ENODEV; |
@@ -404,12 +357,6 @@ int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh) | |||
404 | bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, | 357 | bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, |
405 | scsi_dh_notifier_remove); | 358 | scsi_dh_notifier_remove); |
406 | 359 | ||
407 | for (i = 0; scsi_dh->devlist && scsi_dh->devlist[i].vendor; i++) { | ||
408 | scsi_dev_info_list_del_keyed(scsi_dh->devlist[i].vendor, | ||
409 | scsi_dh->devlist[i].model, | ||
410 | SCSI_DEVINFO_DH); | ||
411 | } | ||
412 | |||
413 | spin_lock(&list_lock); | 360 | spin_lock(&list_lock); |
414 | list_del(&scsi_dh->list); | 361 | list_del(&scsi_dh->list); |
415 | spin_unlock(&list_lock); | 362 | spin_unlock(&list_lock); |
@@ -588,10 +535,6 @@ static int __init scsi_dh_init(void) | |||
588 | { | 535 | { |
589 | int r; | 536 | int r; |
590 | 537 | ||
591 | r = scsi_dev_info_add_list(SCSI_DEVINFO_DH, "SCSI Device Handler"); | ||
592 | if (r) | ||
593 | return r; | ||
594 | |||
595 | r = bus_register_notifier(&scsi_bus_type, &scsi_dh_nb); | 538 | r = bus_register_notifier(&scsi_bus_type, &scsi_dh_nb); |
596 | 539 | ||
597 | if (!r) | 540 | if (!r) |
@@ -606,7 +549,6 @@ static void __exit scsi_dh_exit(void) | |||
606 | bus_for_each_dev(&scsi_bus_type, NULL, NULL, | 549 | bus_for_each_dev(&scsi_bus_type, NULL, NULL, |
607 | scsi_dh_sysfs_attr_remove); | 550 | scsi_dh_sysfs_attr_remove); |
608 | bus_unregister_notifier(&scsi_bus_type, &scsi_dh_nb); | 551 | bus_unregister_notifier(&scsi_bus_type, &scsi_dh_nb); |
609 | scsi_dev_info_remove_list(SCSI_DEVINFO_DH); | ||
610 | } | 552 | } |
611 | 553 | ||
612 | module_init(scsi_dh_init); | 554 | module_init(scsi_dh_init); |
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 591186cf1896..e1c8be06de9d 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c | |||
@@ -629,6 +629,24 @@ static const struct scsi_dh_devlist clariion_dev_list[] = { | |||
629 | {NULL, NULL}, | 629 | {NULL, NULL}, |
630 | }; | 630 | }; |
631 | 631 | ||
632 | static bool clariion_match(struct scsi_device *sdev) | ||
633 | { | ||
634 | int i; | ||
635 | |||
636 | if (scsi_device_tpgs(sdev)) | ||
637 | return false; | ||
638 | |||
639 | for (i = 0; clariion_dev_list[i].vendor; i++) { | ||
640 | if (!strncmp(sdev->vendor, clariion_dev_list[i].vendor, | ||
641 | strlen(clariion_dev_list[i].vendor)) && | ||
642 | !strncmp(sdev->model, clariion_dev_list[i].model, | ||
643 | strlen(clariion_dev_list[i].model))) { | ||
644 | return true; | ||
645 | } | ||
646 | } | ||
647 | return false; | ||
648 | } | ||
649 | |||
632 | static int clariion_bus_attach(struct scsi_device *sdev); | 650 | static int clariion_bus_attach(struct scsi_device *sdev); |
633 | static void clariion_bus_detach(struct scsi_device *sdev); | 651 | static void clariion_bus_detach(struct scsi_device *sdev); |
634 | 652 | ||
@@ -642,6 +660,7 @@ static struct scsi_device_handler clariion_dh = { | |||
642 | .activate = clariion_activate, | 660 | .activate = clariion_activate, |
643 | .prep_fn = clariion_prep_fn, | 661 | .prep_fn = clariion_prep_fn, |
644 | .set_params = clariion_set_params, | 662 | .set_params = clariion_set_params, |
663 | .match = clariion_match, | ||
645 | }; | 664 | }; |
646 | 665 | ||
647 | static int clariion_bus_attach(struct scsi_device *sdev) | 666 | static int clariion_bus_attach(struct scsi_device *sdev) |
diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 0f86a18b157d..084062bb8ee9 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c | |||
@@ -320,6 +320,24 @@ static const struct scsi_dh_devlist hp_sw_dh_data_list[] = { | |||
320 | {NULL, NULL}, | 320 | {NULL, NULL}, |
321 | }; | 321 | }; |
322 | 322 | ||
323 | static bool hp_sw_match(struct scsi_device *sdev) | ||
324 | { | ||
325 | int i; | ||
326 | |||
327 | if (scsi_device_tpgs(sdev)) | ||
328 | return false; | ||
329 | |||
330 | for (i = 0; hp_sw_dh_data_list[i].vendor; i++) { | ||
331 | if (!strncmp(sdev->vendor, hp_sw_dh_data_list[i].vendor, | ||
332 | strlen(hp_sw_dh_data_list[i].vendor)) && | ||
333 | !strncmp(sdev->model, hp_sw_dh_data_list[i].model, | ||
334 | strlen(hp_sw_dh_data_list[i].model))) { | ||
335 | return true; | ||
336 | } | ||
337 | } | ||
338 | return false; | ||
339 | } | ||
340 | |||
323 | static int hp_sw_bus_attach(struct scsi_device *sdev); | 341 | static int hp_sw_bus_attach(struct scsi_device *sdev); |
324 | static void hp_sw_bus_detach(struct scsi_device *sdev); | 342 | static void hp_sw_bus_detach(struct scsi_device *sdev); |
325 | 343 | ||
@@ -331,6 +349,7 @@ static struct scsi_device_handler hp_sw_dh = { | |||
331 | .detach = hp_sw_bus_detach, | 349 | .detach = hp_sw_bus_detach, |
332 | .activate = hp_sw_activate, | 350 | .activate = hp_sw_activate, |
333 | .prep_fn = hp_sw_prep_fn, | 351 | .prep_fn = hp_sw_prep_fn, |
352 | .match = hp_sw_match, | ||
334 | }; | 353 | }; |
335 | 354 | ||
336 | static int hp_sw_bus_attach(struct scsi_device *sdev) | 355 | static int hp_sw_bus_attach(struct scsi_device *sdev) |
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 1d3127920063..841ebf4a6788 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
@@ -820,6 +820,24 @@ static const struct scsi_dh_devlist rdac_dev_list[] = { | |||
820 | {NULL, NULL}, | 820 | {NULL, NULL}, |
821 | }; | 821 | }; |
822 | 822 | ||
823 | static bool rdac_match(struct scsi_device *sdev) | ||
824 | { | ||
825 | int i; | ||
826 | |||
827 | if (scsi_device_tpgs(sdev)) | ||
828 | return false; | ||
829 | |||
830 | for (i = 0; rdac_dev_list[i].vendor; i++) { | ||
831 | if (!strncmp(sdev->vendor, rdac_dev_list[i].vendor, | ||
832 | strlen(rdac_dev_list[i].vendor)) && | ||
833 | !strncmp(sdev->model, rdac_dev_list[i].model, | ||
834 | strlen(rdac_dev_list[i].model))) { | ||
835 | return true; | ||
836 | } | ||
837 | } | ||
838 | return false; | ||
839 | } | ||
840 | |||
823 | static int rdac_bus_attach(struct scsi_device *sdev); | 841 | static int rdac_bus_attach(struct scsi_device *sdev); |
824 | static void rdac_bus_detach(struct scsi_device *sdev); | 842 | static void rdac_bus_detach(struct scsi_device *sdev); |
825 | 843 | ||
@@ -832,6 +850,7 @@ static struct scsi_device_handler rdac_dh = { | |||
832 | .attach = rdac_bus_attach, | 850 | .attach = rdac_bus_attach, |
833 | .detach = rdac_bus_detach, | 851 | .detach = rdac_bus_detach, |
834 | .activate = rdac_activate, | 852 | .activate = rdac_activate, |
853 | .match = rdac_match, | ||
835 | }; | 854 | }; |
836 | 855 | ||
837 | static int rdac_bus_attach(struct scsi_device *sdev) | 856 | static int rdac_bus_attach(struct scsi_device *sdev) |