]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/scsi/scsi_transport_fc.c
[SCSI] mptscsih: remove unused page 1 setting function
[mirror_ubuntu-bionic-kernel.git] / drivers / scsi / scsi_transport_fc.c
index 685b997306cfcd4ca8758621e6e815d9d17da01c..56012b2694d2f8ff22736a13cfc61cf60264396e 100644 (file)
@@ -295,6 +295,7 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
         */
        fc_host_node_name(shost) = -1;
        fc_host_port_name(shost) = -1;
+       fc_host_permanent_port_name(shost) = -1;
        fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED;
        memset(fc_host_supported_fc4s(shost), 0,
                sizeof(fc_host_supported_fc4s(shost)));
@@ -795,6 +796,8 @@ static FC_CLASS_DEVICE_ATTR(host, supported_speeds, S_IRUGO,
 
 fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long);
 fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long);
+fc_private_host_rd_attr_cast(permanent_port_name, "0x%llx\n", 20,
+                            unsigned long long);
 fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1));
 fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20);
 fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1));
@@ -1090,31 +1093,35 @@ 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 *
 fc_attach_transport(struct fc_function_template *ft)
 {
-       struct fc_internal *i = kmalloc(sizeof(struct fc_internal),
-                                       GFP_KERNEL);
        int count;
+       struct fc_internal *i = kzalloc(sizeof(struct fc_internal),
+                                       GFP_KERNEL);
 
        if (unlikely(!i))
                return NULL;
 
-       memset(i, 0, sizeof(struct fc_internal));
-
        i->t.target_attrs.ac.attrs = &i->starget_attrs[0];
        i->t.target_attrs.ac.class = &fc_transport_class.class;
        i->t.target_attrs.ac.match = fc_target_match;
@@ -1139,7 +1146,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.
@@ -1160,6 +1167,7 @@ fc_attach_transport(struct fc_function_template *ft)
        count=0;
        SETUP_HOST_ATTRIBUTE_RD(node_name);
        SETUP_HOST_ATTRIBUTE_RD(port_name);
+       SETUP_HOST_ATTRIBUTE_RD(permanent_port_name);
        SETUP_HOST_ATTRIBUTE_RD(supported_classes);
        SETUP_HOST_ATTRIBUTE_RD(supported_fc4s);
        SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
@@ -1295,12 +1303,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
        size_t size;
 
        size = (sizeof(struct fc_rport) + fci->f->dd_fcrport_size);
-       rport = kmalloc(size, GFP_KERNEL);
+       rport = kzalloc(size, GFP_KERNEL);
        if (unlikely(!rport)) {
                printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);
                return NULL;
        }
-       memset(rport, 0, size);
 
        rport->maxframe_size = -1;
        rport->supported_classes = FC_COS_UNSPECIFIED;