[SCSI] fc class: add fc host default default dev loss setting
[deliverable/linux.git] / drivers / scsi / scsi_transport_fc.c
index edb6b362a8fa7cbb1d73c1d8f94db224ec7b1036..9f0f7d9c7422d7ec9f15fedfa8ffe8452c32bdfc 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/kernel.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport.h>
@@ -1730,12 +1731,11 @@ fc_parse_wwn(const char *ns, u64 *nm)
 
        /* Validate and store the new name */
        for (i=0, j=0; i < 16; i++) {
-               if ((*ns >= 'a') && (*ns <= 'f'))
-                       j = ((j << 4) | ((*ns++ -'a') + 10));
-               else if ((*ns >= 'A') && (*ns <= 'F'))
-                       j = ((j << 4) | ((*ns++ -'A') + 10));
-               else if ((*ns >= '0') && (*ns <= '9'))
-                       j = ((j << 4) | (*ns++ -'0'));
+               int value;
+
+               value = hex_to_bin(*ns++);
+               if (value >= 0)
+                       j = (j << 4) | value;
                else
                        return -EINVAL;
                if (i % 2) {
@@ -2525,7 +2525,11 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
 
        rport->maxframe_size = -1;
        rport->supported_classes = FC_COS_UNSPECIFIED;
-       rport->dev_loss_tmo = fc_dev_loss_tmo;
+       if (fci->f->get_host_def_dev_loss_tmo) {
+               fci->f->get_host_def_dev_loss_tmo(shost);
+               rport->dev_loss_tmo = fc_host_def_dev_loss_tmo(shost);
+       } else
+               rport->dev_loss_tmo = fc_dev_loss_tmo;
        memcpy(&rport->node_name, &ids->node_name, sizeof(rport->node_name));
        memcpy(&rport->port_name, &ids->port_name, sizeof(rport->port_name));
        rport->port_id = ids->port_id;
This page took 0.026587 seconds and 5 git commands to generate.