diff options
author | FUJITA Tomonori <tomof@acm.org> | 2007-08-01 11:20:34 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:38:09 -0400 |
commit | 0012fdf986c9b9c7fe8d0842a0ad8dd981a06c06 (patch) | |
tree | 61c4d1d819c34c60f90c4544c66817470a38e404 | |
parent | e9906fe8c6e8d004635753b7c4189692df281b70 (diff) |
[SCSI] scsi_transport_srp: remove tgt dependencies
it's better to remove tgt dependencies in srp transport class since
most people want only initiator support.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/Kconfig | 11 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_srp.c | 10 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_srp_internal.h | 25 |
3 files changed, 39 insertions, 7 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 4562273dfad3..7877dfdd2322 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -291,11 +291,18 @@ source "drivers/scsi/libsas/Kconfig" | |||
291 | 291 | ||
292 | config SCSI_SRP_ATTRS | 292 | config SCSI_SRP_ATTRS |
293 | tristate "SRP Transport Attributes" | 293 | tristate "SRP Transport Attributes" |
294 | depends on SCSI && SCSI_TGT | 294 | depends on SCSI |
295 | help | 295 | help |
296 | If you wish to export transport-specific information about | 296 | If you wish to export transport-specific information about |
297 | each attached SRP device to sysfs, say Y. | 297 | each attached SRP device to sysfs, say Y. |
298 | 298 | ||
299 | config SCSI_SRP_TGT_ATTRS | ||
300 | bool "SCSI target support for SRP Transport Attributes" | ||
301 | depends on SCSI_SRP_ATTRS | ||
302 | depends on SCSI_TGT = y || SCSI_TGT = SCSI_SRP_ATTRS | ||
303 | help | ||
304 | If you want to use SCSI target mode drivers enable this option. | ||
305 | |||
299 | endmenu | 306 | endmenu |
300 | 307 | ||
301 | menuconfig SCSI_LOWLEVEL | 308 | menuconfig SCSI_LOWLEVEL |
@@ -848,7 +855,7 @@ config SCSI_IBMVSCSI | |||
848 | 855 | ||
849 | config SCSI_IBMVSCSIS | 856 | config SCSI_IBMVSCSIS |
850 | tristate "IBM Virtual SCSI Server support" | 857 | tristate "IBM Virtual SCSI Server support" |
851 | depends on PPC_PSERIES && SCSI_TGT && SCSI_SRP && SCSI_SRP_ATTRS | 858 | depends on PPC_PSERIES && SCSI_SRP && SCSI_SRP_TGT_ATTRS |
852 | help | 859 | help |
853 | This is the SRP target driver for IBM pSeries virtual environments. | 860 | This is the SRP target driver for IBM pSeries virtual environments. |
854 | 861 | ||
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index cdd001a6639c..430501ef9f02 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <scsi/scsi_host.h> | 30 | #include <scsi/scsi_host.h> |
31 | #include <scsi/scsi_transport.h> | 31 | #include <scsi/scsi_transport.h> |
32 | #include <scsi/scsi_transport_srp.h> | 32 | #include <scsi/scsi_transport_srp.h> |
33 | #include <scsi/scsi_tgt.h> | 33 | #include "scsi_transport_srp_internal.h" |
34 | 34 | ||
35 | struct srp_host_attrs { | 35 | struct srp_host_attrs { |
36 | atomic_t next_port_id; | 36 | atomic_t next_port_id; |
@@ -223,8 +223,8 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, | |||
223 | } | 223 | } |
224 | 224 | ||
225 | if (ids->roles == SRP_RPORT_ROLE_INITIATOR) { | 225 | if (ids->roles == SRP_RPORT_ROLE_INITIATOR) { |
226 | ret = scsi_tgt_it_nexus_create(shost, (unsigned long)rport, | 226 | ret = srp_tgt_it_nexus_create(shost, (unsigned long)rport, |
227 | rport->port_id); | 227 | rport->port_id); |
228 | if (ret) { | 228 | if (ret) { |
229 | device_del(&rport->dev); | 229 | device_del(&rport->dev); |
230 | transport_destroy_device(&rport->dev); | 230 | transport_destroy_device(&rport->dev); |
@@ -251,8 +251,8 @@ void srp_rport_del(struct srp_rport *rport) | |||
251 | struct device *dev = &rport->dev; | 251 | struct device *dev = &rport->dev; |
252 | 252 | ||
253 | if (rport->roles == SRP_RPORT_ROLE_INITIATOR) | 253 | if (rport->roles == SRP_RPORT_ROLE_INITIATOR) |
254 | scsi_tgt_it_nexus_destroy(dev_to_shost(dev->parent), | 254 | srp_tgt_it_nexus_destroy(dev_to_shost(dev->parent), |
255 | (unsigned long)rport); | 255 | (unsigned long)rport); |
256 | 256 | ||
257 | transport_remove_device(dev); | 257 | transport_remove_device(dev); |
258 | device_del(dev); | 258 | device_del(dev); |
diff --git a/drivers/scsi/scsi_transport_srp_internal.h b/drivers/scsi/scsi_transport_srp_internal.h new file mode 100644 index 000000000000..8a79747f9f3d --- /dev/null +++ b/drivers/scsi/scsi_transport_srp_internal.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #include <scsi/scsi_tgt.h> | ||
2 | |||
3 | #ifdef CONFIG_SCSI_SRP_TGT_ATTRS | ||
4 | static inline int srp_tgt_it_nexus_create(struct Scsi_Host *shost, u64 itn_id, | ||
5 | char *initiator) | ||
6 | { | ||
7 | return scsi_tgt_it_nexus_create(shost, itn_id, initiator); | ||
8 | } | ||
9 | |||
10 | static inline int srp_tgt_it_nexus_destroy(struct Scsi_Host *shost, u64 itn_id) | ||
11 | { | ||
12 | return scsi_tgt_it_nexus_destroy(shost, itn_id); | ||
13 | } | ||
14 | |||
15 | #else | ||
16 | static inline int srp_tgt_it_nexus_create(struct Scsi_Host *shost, u64 itn_id, | ||
17 | char *initiator) | ||
18 | { | ||
19 | return 0; | ||
20 | } | ||
21 | static inline int srp_tgt_it_nexus_destroy(struct Scsi_Host *shost, u64 itn_id) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | #endif | ||