scsi_transport_srp.h 1.07 KB
Newer Older
1 2 3 4 5 6 7
#ifndef SCSI_TRANSPORT_SRP_H
#define SCSI_TRANSPORT_SRP_H

#include <linux/transport_class.h>
#include <linux/types.h>
#include <linux/mutex.h>

8 9 10
#define SRP_RPORT_ROLE_INITIATOR 0
#define SRP_RPORT_ROLE_TARGET 1

11 12
struct srp_rport_identifiers {
	u8 port_id[16];
13
	u8 roles;
14 15 16
};

struct srp_rport {
17 18
	/* for initiator and target drivers */

19 20 21
	struct device dev;

	u8 port_id[16];
22
	u8 roles;
23 24 25 26

	/* for initiator drivers */

	void *lld_data;	/* LLD private data */
27 28 29
};

struct srp_function_template {
30 31
	/* for initiator drivers */
	void (*rport_delete)(struct srp_rport *rport);
32
	/* for target drivers */
33
	int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
34
	int (* it_nexus_response)(struct Scsi_Host *, u64, int);
35 36 37 38 39 40 41 42 43 44 45 46 47
};

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