blob: 9c60ca1c08c5a12ac77ba84f3d046cbd21fc60df [file] [log] [blame]
FUJITA Tomonori09345f62007-06-27 16:32:39 +09001#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 Tomonoriaebd5e42007-07-11 15:08:15 +09008#define SRP_RPORT_ROLE_INITIATOR 0
9#define SRP_RPORT_ROLE_TARGET 1
10
FUJITA Tomonori09345f62007-06-27 16:32:39 +090011struct srp_rport_identifiers {
12 u8 port_id[16];
FUJITA Tomonoriaebd5e42007-07-11 15:08:15 +090013 u8 roles;
FUJITA Tomonori09345f62007-06-27 16:32:39 +090014};
15
16struct srp_rport {
17 struct device dev;
18
19 u8 port_id[16];
FUJITA Tomonoriaebd5e42007-07-11 15:08:15 +090020 u8 roles;
FUJITA Tomonori09345f62007-06-27 16:32:39 +090021};
22
23struct srp_function_template {
FUJITA Tomonori62fe8822007-07-11 15:08:19 +090024 /* for target drivers */
FUJITA Tomonoribfb74372007-07-11 15:08:22 +090025 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
FUJITA Tomonori62fe8822007-07-11 15:08:19 +090026 int (* it_nexus_response)(struct Scsi_Host *, u64, int);
FUJITA Tomonori09345f62007-06-27 16:32:39 +090027};
28
29extern struct scsi_transport_template *
30srp_attach_transport(struct srp_function_template *);
31extern void srp_release_transport(struct scsi_transport_template *);
32
33extern struct srp_rport *srp_rport_add(struct Scsi_Host *,
34 struct srp_rport_identifiers *);
35extern void srp_rport_del(struct srp_rport *);
36
37extern void srp_remove_host(struct Scsi_Host *);
38
39#endif