aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorSarang Radke <sarang.radke@qlogic.com>2010-03-19 20:03:59 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:45:50 -0400
commit09ff701a177b116c6c15b6e501e58fbfb306b424 (patch)
treefd99933ea29dbc36fc6636f5278d237dbee89b96 /drivers/scsi/qla2xxx/qla_mbx.c
parent6e98016ca077c5c751167bfdb1a3a2a3bee581cf (diff)
[SCSI] qla2xxx: Add APEX support.
Allows priority setting for FCP_CMNDs. 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_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 7f3bc45d2e20..e9c9f82c1d87 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -3896,3 +3896,50 @@ qla2x00_get_data_rate(scsi_qla_host_t *vha)
3896 3896
3897 return rval; 3897 return rval;
3898} 3898}
3899
3900int
3901qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority,
3902 uint16_t *mb)
3903{
3904 int rval;
3905 mbx_cmd_t mc;
3906 mbx_cmd_t *mcp = &mc;
3907 struct qla_hw_data *ha = vha->hw;
3908
3909 if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha))
3910 return QLA_FUNCTION_FAILED;
3911
3912 DEBUG11(printk(KERN_INFO
3913 "%s(%ld): entered.\n", __func__, ha->host_no));
3914
3915 mcp->mb[0] = MBC_PORT_PARAMS;
3916 mcp->mb[1] = loop_id;
3917 if (ha->flags.fcp_prio_enabled)
3918 mcp->mb[2] = BIT_1;
3919 else
3920 mcp->mb[2] = BIT_2;
3921 mcp->mb[4] = priority & 0xf;
3922 mcp->mb[9] = vha->vp_idx;
3923 mcp->out_mb = MBX_9|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
3924 mcp->in_mb = MBX_4|MBX_3|MBX_1|MBX_0;
3925 mcp->tov = 30;
3926 mcp->flags = 0;
3927 rval = qla2x00_mailbox_command(vha, mcp);
3928 if (mb != NULL) {
3929 mb[0] = mcp->mb[0];
3930 mb[1] = mcp->mb[1];
3931 mb[3] = mcp->mb[3];
3932 mb[4] = mcp->mb[4];
3933 }
3934
3935 if (rval != QLA_SUCCESS) {
3936 DEBUG2_3_11(printk(KERN_WARNING
3937 "%s(%ld): failed=%x.\n", __func__,
3938 vha->host_no, rval));
3939 } else {
3940 DEBUG11(printk(KERN_INFO
3941 "%s(%ld): done.\n", __func__, vha->host_no));
3942 }
3943
3944 return rval;
3945}