scsi_transport_srp.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef SCSI_TRANSPORT_SRP_H
  2. #define SCSI_TRANSPORT_SRP_H
  3. #include <linux/transport_class.h>
  4. #include <linux/types.h>
  5. #include <linux/mutex.h>
  6. #define SRP_RPORT_ROLE_INITIATOR 0
  7. #define SRP_RPORT_ROLE_TARGET 1
  8. struct srp_rport_identifiers {
  9. u8 port_id[16];
  10. u8 roles;
  11. };
  12. struct srp_rport {
  13. /* for initiator and target drivers */
  14. struct device dev;
  15. u8 port_id[16];
  16. u8 roles;
  17. /* for initiator drivers */
  18. void *lld_data; /* LLD private data */
  19. };
  20. struct srp_function_template {
  21. /* for initiator drivers */
  22. void (*rport_delete)(struct srp_rport *rport);
  23. /* for target drivers */
  24. int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
  25. int (* it_nexus_response)(struct Scsi_Host *, u64, int);
  26. };
  27. extern struct scsi_transport_template *
  28. srp_attach_transport(struct srp_function_template *);
  29. extern void srp_release_transport(struct scsi_transport_template *);
  30. extern struct srp_rport *srp_rport_add(struct Scsi_Host *,
  31. struct srp_rport_identifiers *);
  32. extern void srp_rport_del(struct srp_rport *);
  33. extern void srp_remove_host(struct Scsi_Host *);
  34. #endif