diff options
author | Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> | 2010-07-23 15:28:24 +0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 09:06:08 -0500 |
commit | 2f0f3f4f06f7cfadebf58b70bd9e7f71d8fd96e4 (patch) | |
tree | a830ea66f0f4aca7da0e915d30dca8c1be6cfe28 /drivers/scsi/qla2xxx/qla_bsg.c | |
parent | d94d10e7277069801b4e31b40770314a8421f996 (diff) |
[SCSI] qla2xxx: Appropriately log FCP priority data messages
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_bsg.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 20eaa1c42ae..d551ae19d4e 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -41,13 +41,28 @@ qla24xx_fcp_prio_cfg_valid(struct qla_fcp_prio_cfg *pri_cfg, uint8_t flag) int i, ret, num_valid; uint8_t *bcode; struct qla_fcp_prio_entry *pri_entry; + uint32_t *bcode_val_ptr, bcode_val; ret = 1; num_valid = 0; bcode = (uint8_t *)pri_cfg; + bcode_val_ptr = (uint32_t *)pri_cfg; + bcode_val = (uint32_t)(*bcode_val_ptr); - if (bcode[0x0] != 'H' || bcode[0x1] != 'Q' || bcode[0x2] != 'O' || - bcode[0x3] != 'S') { + if (bcode_val == 0xFFFFFFFF) { + /* No FCP Priority config data in flash */ + DEBUG2(printk(KERN_INFO + "%s: No FCP priority config data.\n", + __func__)); + return 0; + } + + if (bcode[0] != 'H' || bcode[1] != 'Q' || bcode[2] != 'O' || + bcode[3] != 'S') { + /* Invalid FCP priority data header*/ + DEBUG2(printk(KERN_ERR + "%s: Invalid FCP Priority data header. bcode=0x%x\n", + __func__, bcode_val)); return 0; } if (flag != 1) @@ -60,8 +75,18 @@ qla24xx_fcp_prio_cfg_valid(struct qla_fcp_prio_cfg *pri_cfg, uint8_t flag) pri_entry++; } - if (num_valid == 0) + if (num_valid == 0) { + /* No valid FCP priority data entries */ + DEBUG2(printk(KERN_ERR + "%s: No valid FCP Priority data entries.\n", + __func__)); ret = 0; + } else { + /* FCP priority data is valid */ + DEBUG2(printk(KERN_INFO + "%s: Valid FCP priority data. num entries = %d\n", + __func__, num_valid)); + } return ret; } @@ -78,6 +103,11 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) bsg_job->reply->reply_payload_rcv_len = 0; + if (!IS_QLA24XX_TYPE(ha) || !IS_QLA25XX(ha)) { + ret = -EINVAL; + goto exit_fcp_prio_cfg; + } + if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { |