]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/scsi_transport_fc.c
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / drivers / scsi / scsi_transport_fc.c
index 625f4a664d0601dd049a0ed2614ed959c4a1a055..f2c9acf11bd0c394084230718cfcbf48614d6e59 100644 (file)
@@ -1093,17 +1093,23 @@ static int fc_rport_match(struct attribute_container *cont,
 /*
  * Must be called with shost->host_lock held
  */
-static struct device *fc_target_parent(struct Scsi_Host *shost,
-                                       int channel, uint id)
+static int fc_user_scan(struct Scsi_Host *shost, uint channel,
+               uint id, uint lun)
 {
        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;
+       list_for_each_entry(rport, &fc_host_rports(shost), peers) {
+               if (rport->scsi_target_id == -1)
+                       continue;
 
-       return NULL;
+               if ((channel == SCAN_WILD_CARD || channel == rport->channel) &&
+                   (id == SCAN_WILD_CARD || id == rport->scsi_target_id)) {
+                       scsi_scan_target(&rport->dev, rport->channel,
+                                        rport->scsi_target_id, lun, 1);
+               }
+       }
+
+       return 0;
 }
 
 struct scsi_transport_template *
@@ -1142,7 +1148,7 @@ 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;
+       i->t.user_scan = fc_user_scan;
        
        /*
         * Setup SCSI Target Attributes.