aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-08-26 22:08:10 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-04 20:53:04 -0400
commitad3e0edaceb9771be7ffbd7aa24fb444a7ed85bf (patch)
tree0815f12f6e026ea220c03605f1b7e122b265c143 /drivers
parent7524f9b9e72cd36f0a70defcd424eba81c180f42 (diff)
[SCSI] qla2xxx: Export class-of-service (COS) information.
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c4
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c7
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c14
4 files changed, 26 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 659a5d63467d..d05280eecc60 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -304,10 +304,13 @@ struct fc_function_template qla2xxx_transport_functions = {
304 304
305 .show_host_node_name = 1, 305 .show_host_node_name = 1,
306 .show_host_port_name = 1, 306 .show_host_port_name = 1,
307 .show_host_supported_classes = 1,
308
307 .get_host_port_id = qla2x00_get_host_port_id, 309 .get_host_port_id = qla2x00_get_host_port_id,
308 .show_host_port_id = 1, 310 .show_host_port_id = 1,
309 311
310 .dd_fcrport_size = sizeof(struct fc_port *), 312 .dd_fcrport_size = sizeof(struct fc_port *),
313 .show_rport_supported_classes = 1,
311 314
312 .get_starget_node_name = qla2x00_get_starget_node_name, 315 .get_starget_node_name = qla2x00_get_starget_node_name,
313 .show_starget_node_name = 1, 316 .show_starget_node_name = 1,
@@ -329,4 +332,5 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha)
329 be64_to_cpu(*(uint64_t *)ha->init_cb->node_name); 332 be64_to_cpu(*(uint64_t *)ha->init_cb->node_name);
330 fc_host_port_name(ha->host) = 333 fc_host_port_name(ha->host) =
331 be64_to_cpu(*(uint64_t *)ha->init_cb->port_name); 334 be64_to_cpu(*(uint64_t *)ha->init_cb->port_name);
335 fc_host_supported_classes(ha->host) = FC_COS_CLASS3;
332} 336}
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 1c6d366f4fad..38848c38ad8d 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1673,6 +1673,7 @@ typedef struct fc_port {
1673 uint8_t cur_path; /* current path id */ 1673 uint8_t cur_path; /* current path id */
1674 1674
1675 struct fc_rport *rport; 1675 struct fc_rport *rport;
1676 u32 supported_classes;
1676} fc_port_t; 1677} fc_port_t;
1677 1678
1678/* 1679/*
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index a6d2559217cd..09b23f70fd66 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1697,6 +1697,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, int flags)
1697 fcport->iodesc_idx_sent = IODESC_INVALID_INDEX; 1697 fcport->iodesc_idx_sent = IODESC_INVALID_INDEX;
1698 atomic_set(&fcport->state, FCS_UNCONFIGURED); 1698 atomic_set(&fcport->state, FCS_UNCONFIGURED);
1699 fcport->flags = FCF_RLC_SUPPORT; 1699 fcport->flags = FCF_RLC_SUPPORT;
1700 fcport->supported_classes = FC_COS_UNSPECIFIED;
1700 1701
1701 return (fcport); 1702 return (fcport);
1702} 1703}
@@ -2075,6 +2076,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
2075 return; 2076 return;
2076 } 2077 }
2077 rport->dd_data = fcport; 2078 rport->dd_data = fcport;
2079 rport->supported_classes = fcport->supported_classes;
2078 2080
2079 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; 2081 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
2080 if (fcport->port_type == FCT_INITIATOR) 2082 if (fcport->port_type == FCT_INITIATOR)
@@ -2794,6 +2796,11 @@ qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
2794 } 2796 }
2795 } 2797 }
2796 2798
2799 if (mb[10] & BIT_0)
2800 fcport->supported_classes |= FC_COS_CLASS2;
2801 if (mb[10] & BIT_1)
2802 fcport->supported_classes |= FC_COS_CLASS3;
2803
2797 rval = QLA_SUCCESS; 2804 rval = QLA_SUCCESS;
2798 break; 2805 break;
2799 } else if (mb[0] == MBS_LOOP_ID_USED) { 2806 } else if (mb[0] == MBS_LOOP_ID_USED) {
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 409ea0ac4032..774309a77c05 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -19,6 +19,7 @@
19#include "qla_def.h" 19#include "qla_def.h"
20 20
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <scsi/scsi_transport_fc.h>
22 23
23static void 24static void
24qla2x00_mbx_sem_timeout(unsigned long data) 25qla2x00_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)
1326 fcport->port_type = FCT_INITIATOR; 1327 fcport->port_type = FCT_INITIATOR;
1327 else 1328 else
1328 fcport->port_type = FCT_TARGET; 1329 fcport->port_type = FCT_TARGET;
1330
1331 /* Passback COS information. */
1332 fcport->supported_classes = (pd->options & BIT_4) ?
1333 FC_COS_CLASS2: FC_COS_CLASS3;
1329 } 1334 }
1330 1335
1331gpd_error_out: 1336gpd_error_out:
@@ -1661,6 +1666,13 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
1661 mb[1] |= BIT_1; 1666 mb[1] |= BIT_1;
1662 } else 1667 } else
1663 mb[1] = BIT_0; 1668 mb[1] = BIT_0;
1669
1670 /* Passback COS information. */
1671 mb[10] = 0;
1672 if (lg->io_parameter[7] || lg->io_parameter[8])
1673 mb[10] |= BIT_0; /* Class 2. */
1674 if (lg->io_parameter[9] || lg->io_parameter[10])
1675 mb[10] |= BIT_1; /* Class 3. */
1664 } 1676 }
1665 1677
1666 dma_pool_free(ha->s_dma_pool, lg, lg_dma); 1678 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,
1723 mb[2] = mcp->mb[2]; 1735 mb[2] = mcp->mb[2];
1724 mb[6] = mcp->mb[6]; 1736 mb[6] = mcp->mb[6];
1725 mb[7] = mcp->mb[7]; 1737 mb[7] = mcp->mb[7];
1738 /* COS retrieved from Get-Port-Database mailbox command. */
1739 mb[10] = 0;
1726 } 1740 }
1727 1741
1728 if (rval != QLA_SUCCESS) { 1742 if (rval != QLA_SUCCESS) {