aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2011-03-30 14:46:18 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 10:56:57 -0400
commitf28a0a96130e7557d0cdcba0bcd394735eadfad8 (patch)
tree5b7d92d65aae06db15f1ef6a693324955eb5ccdf
parent80d79440ad98a660bd6d81e5c06e85581ff6ac46 (diff)
[SCSI] qla2xxx: Check for a match before attempting to set FCP-priority information.
Modifying qla24xx_get_fcp_prio() to return a 'found' status allows the driver to short circuit the 'set FCP-priority' call and reduce the amount of noise generated in the messages file: scsi(5): Unable to activate fcp priority, ret=0x102 scsi(5): Unable to activate fcp priority, ret=0x102 Also make qla24xx_get_fcp_prio() static. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 394d03d82c6a..f98cfac69e04 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -5508,26 +5508,26 @@ qla81xx_update_fw_options(scsi_qla_host_t *vha)
5508 * 5508 *
5509 * Return: 5509 * Return:
5510 * non-zero (if found) 5510 * non-zero (if found)
5511 * 0 (if not found) 5511 * -1 (if not found)
5512 * 5512 *
5513 * Context: 5513 * Context:
5514 * Kernel context 5514 * Kernel context
5515 */ 5515 */
5516uint8_t 5516static int
5517qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) 5517qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
5518{ 5518{
5519 int i, entries; 5519 int i, entries;
5520 uint8_t pid_match, wwn_match; 5520 uint8_t pid_match, wwn_match;
5521 uint8_t priority; 5521 int priority;
5522 uint32_t pid1, pid2; 5522 uint32_t pid1, pid2;
5523 uint64_t wwn1, wwn2; 5523 uint64_t wwn1, wwn2;
5524 struct qla_fcp_prio_entry *pri_entry; 5524 struct qla_fcp_prio_entry *pri_entry;
5525 struct qla_hw_data *ha = vha->hw; 5525 struct qla_hw_data *ha = vha->hw;
5526 5526
5527 if (!ha->fcp_prio_cfg || !ha->flags.fcp_prio_enabled) 5527 if (!ha->fcp_prio_cfg || !ha->flags.fcp_prio_enabled)
5528 return 0; 5528 return -1;
5529 5529
5530 priority = 0; 5530 priority = -1;
5531 entries = ha->fcp_prio_cfg->num_entries; 5531 entries = ha->fcp_prio_cfg->num_entries;
5532 pri_entry = &ha->fcp_prio_cfg->entry[0]; 5532 pri_entry = &ha->fcp_prio_cfg->entry[0];
5533 5533
@@ -5610,7 +5610,7 @@ int
5610qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) 5610qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
5611{ 5611{
5612 int ret; 5612 int ret;
5613 uint8_t priority; 5613 int priority;
5614 uint16_t mb[5]; 5614 uint16_t mb[5];
5615 5615
5616 if (fcport->port_type != FCT_TARGET || 5616 if (fcport->port_type != FCT_TARGET ||
@@ -5618,6 +5618,9 @@ qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
5618 return QLA_FUNCTION_FAILED; 5618 return QLA_FUNCTION_FAILED;
5619 5619
5620 priority = qla24xx_get_fcp_prio(vha, fcport); 5620 priority = qla24xx_get_fcp_prio(vha, fcport);
5621 if (priority < 0)
5622 return QLA_FUNCTION_FAILED;
5623
5621 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); 5624 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb);
5622 if (ret == QLA_SUCCESS) 5625 if (ret == QLA_SUCCESS)
5623 fcport->fcp_prio = priority; 5626 fcport->fcp_prio = priority;