Merge HEAD from ../scsi-misc-2.6-tmp
[pandora-kernel.git] / drivers / scsi / scsi_transport_fc.c
index 96243c7..2cab556 100644 (file)
@@ -1024,6 +1024,23 @@ static int fc_rport_match(struct attribute_container *cont,
        return &i->rport_attr_cont.ac == cont;
 }
 
+
+/*
+ * Must be called with shost->host_lock held
+ */
+static struct device *fc_target_parent(struct Scsi_Host *shost,
+                                       int channel, uint id)
+{
+       struct fc_rport *rport;
+
+       list_for_each_entry(rport, &fc_host_rports(shost), peers)
+               if ((rport->channel == channel) &&
+                   (rport->scsi_target_id == id))
+                       return &rport->dev;
+
+       return NULL;
+}
+
 struct scsi_transport_template *
 fc_attach_transport(struct fc_function_template *ft)
 {
@@ -1059,6 +1076,8 @@ fc_attach_transport(struct fc_function_template *ft)
 
        /* Transport uses the shost workq for scsi scanning */
        i->t.create_work_queue = 1;
+
+       i->t.target_parent = fc_target_parent;
        
        /*
         * Setup SCSI Target Attributes.