[SCSI] qla2xxx: Export class-of-service (COS) information.
authorAndrew Vasquez <andrew.vasquez@qlogic.com>
Sat, 27 Aug 2005 02:08:10 +0000 (19:08 -0700)
committerJames Bottomley <jejb@mulgrave.(none)>
Mon, 5 Sep 2005 00:53:04 +0000 (19:53 -0500)
Export COS information for the fc_host and fc_remote_port
objects added by the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mbx.c

index 659a5d63467dc335a570f62e20f4d874bbbabe23..d05280eecc605703a0493a8e5307402799aba350 100644 (file)
@@ -304,10 +304,13 @@ struct fc_function_template qla2xxx_transport_functions = {
 
        .show_host_node_name = 1,
        .show_host_port_name = 1,
 
        .show_host_node_name = 1,
        .show_host_port_name = 1,
+       .show_host_supported_classes = 1,
+
        .get_host_port_id = qla2x00_get_host_port_id,
        .show_host_port_id = 1,
 
        .dd_fcrport_size = sizeof(struct fc_port *),
        .get_host_port_id = qla2x00_get_host_port_id,
        .show_host_port_id = 1,
 
        .dd_fcrport_size = sizeof(struct fc_port *),
+       .show_rport_supported_classes = 1,
 
        .get_starget_node_name = qla2x00_get_starget_node_name,
        .show_starget_node_name = 1,
 
        .get_starget_node_name = qla2x00_get_starget_node_name,
        .show_starget_node_name = 1,
@@ -329,4 +332,5 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha)
            be64_to_cpu(*(uint64_t *)ha->init_cb->node_name);
        fc_host_port_name(ha->host) =
            be64_to_cpu(*(uint64_t *)ha->init_cb->port_name);
            be64_to_cpu(*(uint64_t *)ha->init_cb->node_name);
        fc_host_port_name(ha->host) =
            be64_to_cpu(*(uint64_t *)ha->init_cb->port_name);
+       fc_host_supported_classes(ha->host) = FC_COS_CLASS3;
 }
 }
index 1c6d366f4fad8e716bd2c464bdfc197768497c3a..38848c38ad8d98c68f26ac5c8b0c7e82fb63f3e1 100644 (file)
@@ -1673,6 +1673,7 @@ typedef struct fc_port {
        uint8_t cur_path;               /* current path id */
 
        struct fc_rport *rport;
        uint8_t cur_path;               /* current path id */
 
        struct fc_rport *rport;
+       u32 supported_classes;
 } fc_port_t;
 
 /*
 } fc_port_t;
 
 /*
index a6d2559217cded06fa9737cb9d9989190f9495e8..09b23f70fd66777e6badf33d678986f76a918ea4 100644 (file)
@@ -1697,6 +1697,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, int flags)
        fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
        atomic_set(&fcport->state, FCS_UNCONFIGURED);
        fcport->flags = FCF_RLC_SUPPORT;
        fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
        atomic_set(&fcport->state, FCS_UNCONFIGURED);
        fcport->flags = FCF_RLC_SUPPORT;
+       fcport->supported_classes = FC_COS_UNSPECIFIED;
 
        return (fcport);
 }
 
        return (fcport);
 }
@@ -2075,6 +2076,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
                return;
        }
        rport->dd_data = fcport;
                return;
        }
        rport->dd_data = fcport;
+       rport->supported_classes = fcport->supported_classes;
 
        rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
        if (fcport->port_type == FCT_INITIATOR)
 
        rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
        if (fcport->port_type == FCT_INITIATOR)
@@ -2794,6 +2796,11 @@ qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
                                }
                        }
 
                                }
                        }
 
+                       if (mb[10] & BIT_0)
+                               fcport->supported_classes |= FC_COS_CLASS2;
+                       if (mb[10] & BIT_1)
+                               fcport->supported_classes |= FC_COS_CLASS3;
+
                        rval = QLA_SUCCESS;
                        break;
                } else if (mb[0] == MBS_LOOP_ID_USED) {
                        rval = QLA_SUCCESS;
                        break;
                } else if (mb[0] == MBS_LOOP_ID_USED) {
index 409ea0ac40327804a034604ab5788405c9c35563..774309a77c0535aea1ff8f7428fc2babbde8fd54 100644 (file)
@@ -19,6 +19,7 @@
 #include "qla_def.h"
 
 #include <linux/delay.h>
 #include "qla_def.h"
 
 #include <linux/delay.h>
+#include <scsi/scsi_transport_fc.h>
 
 static void
 qla2x00_mbx_sem_timeout(unsigned long data)
 
 static void
 qla2x00_mbx_sem_timeout(unsigned long data)
@@ -1326,6 +1327,10 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
                        fcport->port_type = FCT_INITIATOR;
                else
                        fcport->port_type = FCT_TARGET;
                        fcport->port_type = FCT_INITIATOR;
                else
                        fcport->port_type = FCT_TARGET;
+
+               /* Passback COS information. */
+               fcport->supported_classes = (pd->options & BIT_4) ?
+                   FC_COS_CLASS2: FC_COS_CLASS3;
        }
 
 gpd_error_out:
        }
 
 gpd_error_out:
@@ -1661,6 +1666,13 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
                                mb[1] |= BIT_1;
                } else
                        mb[1] = BIT_0;
                                mb[1] |= BIT_1;
                } else
                        mb[1] = BIT_0;
+
+               /* Passback COS information. */
+               mb[10] = 0;
+               if (lg->io_parameter[7] || lg->io_parameter[8])
+                       mb[10] |= BIT_0;        /* Class 2. */
+               if (lg->io_parameter[9] || lg->io_parameter[10])
+                       mb[10] |= BIT_1;        /* Class 3. */
        }
 
        dma_pool_free(ha->s_dma_pool, lg, lg_dma);
        }
 
        dma_pool_free(ha->s_dma_pool, lg, lg_dma);
@@ -1723,6 +1735,8 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
                mb[2] = mcp->mb[2];
                mb[6] = mcp->mb[6];
                mb[7] = mcp->mb[7];
                mb[2] = mcp->mb[2];
                mb[6] = mcp->mb[6];
                mb[7] = mcp->mb[7];
+               /* COS retrieved from Get-Port-Database mailbox command. */
+               mb[10] = 0;
        }
 
        if (rval != QLA_SUCCESS) {
        }
 
        if (rval != QLA_SUCCESS) {