FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 1 | #ifndef SCSI_TRANSPORT_SRP_H |
| 2 | #define SCSI_TRANSPORT_SRP_H |
| 3 | |
| 4 | #include <linux/transport_class.h> |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/mutex.h> |
| 7 | |
FUJITA Tomonori | aebd5e4 | 2007-07-11 15:08:15 +0900 | [diff] [blame] | 8 | #define SRP_RPORT_ROLE_INITIATOR 0 |
| 9 | #define SRP_RPORT_ROLE_TARGET 1 |
| 10 | |
FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 11 | struct srp_rport_identifiers { |
| 12 | u8 port_id[16]; |
FUJITA Tomonori | aebd5e4 | 2007-07-11 15:08:15 +0900 | [diff] [blame] | 13 | u8 roles; |
FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | struct srp_rport { |
Bart Van Assche | dc1bdbd | 2011-09-16 20:41:13 +0200 | [diff] [blame] | 17 | /* for initiator and target drivers */ |
| 18 | |
FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 19 | struct device dev; |
| 20 | |
| 21 | u8 port_id[16]; |
FUJITA Tomonori | aebd5e4 | 2007-07-11 15:08:15 +0900 | [diff] [blame] | 22 | u8 roles; |
Bart Van Assche | dc1bdbd | 2011-09-16 20:41:13 +0200 | [diff] [blame] | 23 | |
| 24 | /* for initiator drivers */ |
| 25 | |
| 26 | void *lld_data; /* LLD private data */ |
FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | struct srp_function_template { |
Bart Van Assche | dc1bdbd | 2011-09-16 20:41:13 +0200 | [diff] [blame] | 30 | /* for initiator drivers */ |
| 31 | void (*rport_delete)(struct srp_rport *rport); |
FUJITA Tomonori | 62fe882 | 2007-07-11 15:08:19 +0900 | [diff] [blame] | 32 | /* for target drivers */ |
FUJITA Tomonori | bfb7437 | 2007-07-11 15:08:22 +0900 | [diff] [blame] | 33 | int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); |
FUJITA Tomonori | 62fe882 | 2007-07-11 15:08:19 +0900 | [diff] [blame] | 34 | int (* it_nexus_response)(struct Scsi_Host *, u64, int); |
FUJITA Tomonori | 09345f6 | 2007-06-27 16:32:39 +0900 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | extern struct scsi_transport_template * |
| 38 | srp_attach_transport(struct srp_function_template *); |
| 39 | extern void srp_release_transport(struct scsi_transport_template *); |
| 40 | |
| 41 | extern struct srp_rport *srp_rport_add(struct Scsi_Host *, |
| 42 | struct srp_rport_identifiers *); |
| 43 | extern void srp_rport_del(struct srp_rport *); |
| 44 | |
| 45 | extern void srp_remove_host(struct Scsi_Host *); |
| 46 | |
| 47 | #endif |