2007-06-27 14:32:39 +07:00
|
|
|
#ifndef SCSI_TRANSPORT_SRP_H
|
|
|
|
#define SCSI_TRANSPORT_SRP_H
|
|
|
|
|
|
|
|
#include <linux/transport_class.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
|
2007-07-11 13:08:15 +07:00
|
|
|
#define SRP_RPORT_ROLE_INITIATOR 0
|
|
|
|
#define SRP_RPORT_ROLE_TARGET 1
|
|
|
|
|
2007-06-27 14:32:39 +07:00
|
|
|
struct srp_rport_identifiers {
|
|
|
|
u8 port_id[16];
|
2007-07-11 13:08:15 +07:00
|
|
|
u8 roles;
|
2007-06-27 14:32:39 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct srp_rport {
|
2011-09-17 01:41:13 +07:00
|
|
|
/* for initiator and target drivers */
|
|
|
|
|
2007-06-27 14:32:39 +07:00
|
|
|
struct device dev;
|
|
|
|
|
|
|
|
u8 port_id[16];
|
2007-07-11 13:08:15 +07:00
|
|
|
u8 roles;
|
2011-09-17 01:41:13 +07:00
|
|
|
|
|
|
|
/* for initiator drivers */
|
|
|
|
|
|
|
|
void *lld_data; /* LLD private data */
|
2007-06-27 14:32:39 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct srp_function_template {
|
2011-09-17 01:41:13 +07:00
|
|
|
/* for initiator drivers */
|
|
|
|
void (*rport_delete)(struct srp_rport *rport);
|
2007-07-11 13:08:19 +07:00
|
|
|
/* for target drivers */
|
2007-07-11 13:08:22 +07:00
|
|
|
int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
|
2007-07-11 13:08:19 +07:00
|
|
|
int (* it_nexus_response)(struct Scsi_Host *, u64, int);
|
2007-06-27 14:32:39 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct scsi_transport_template *
|
|
|
|
srp_attach_transport(struct srp_function_template *);
|
|
|
|
extern void srp_release_transport(struct scsi_transport_template *);
|
|
|
|
|
|
|
|
extern struct srp_rport *srp_rport_add(struct Scsi_Host *,
|
|
|
|
struct srp_rport_identifiers *);
|
|
|
|
extern void srp_rport_del(struct srp_rport *);
|
|
|
|
|
|
|
|
extern void srp_remove_host(struct Scsi_Host *);
|
|
|
|
|
|
|
|
#endif
|