#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_srp.h>
+#include <scsi/scsi_tgt.h>
struct srp_host_attrs {
atomic_t next_port_id;
return ERR_PTR(ret);
}
+ if (ids->roles == SRP_RPORT_ROLE_INITIATOR) {
+ ret = scsi_tgt_it_nexus_create(shost, (unsigned long)rport,
+ rport->port_id);
+ if (ret) {
+ device_del(&rport->dev);
+ transport_destroy_device(&rport->dev);
+ put_device(&rport->dev);
+ return ERR_PTR(ret);
+ }
+ }
+
transport_add_device(&rport->dev);
transport_configure_device(&rport->dev);
{
struct device *dev = &rport->dev;
+ if (rport->roles == SRP_RPORT_ROLE_INITIATOR)
+ scsi_tgt_it_nexus_destroy(dev_to_shost(dev->parent),
+ (unsigned long)rport);
+
transport_remove_device(dev);
device_del(dev);
transport_destroy_device(dev);
}
EXPORT_SYMBOL_GPL(srp_remove_host);
+static int srp_it_nexus_response(struct Scsi_Host *shost, u64 id, int result)
+{
+ struct srp_internal *i = to_srp_internal(shost->transportt);
+ return i->f->it_nexus_response(shost, id, result);
+}
+
/**
* srp_attach_transport -- instantiate SRP transport template
* @ft: SRP transport class function template
if (!i)
return NULL;
+ i->t.it_nexus_response = srp_it_nexus_response;
+
i->t.host_size = sizeof(struct srp_host_attrs);
i->t.host_attrs.ac.attrs = &i->host_attrs[0];
i->t.host_attrs.ac.class = &srp_host_class.class;