diff options
author | Sarang Radke <sarang.radke@qlogic.com> | 2010-05-28 18:08:21 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:01:22 -0400 |
commit | 23f2ebd17a13835c5b34994d2c2e5faacc127947 (patch) | |
tree | 2fce122a5ecceffa8c52e334d9dfeee0e33e3e7f /drivers/scsi/qla2xxx/qla_mbx.c | |
parent | 3a6478df74c271cb3be5895b39fddf75e9cef89c (diff) |
[SCSI] qla2xxx: Add internal loopback support for ISP81xx.
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.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 043f808ba3f4..10f4815aec77 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -3950,6 +3950,72 @@ qla2x00_get_data_rate(scsi_qla_host_t *vha) | |||
3950 | } | 3950 | } |
3951 | 3951 | ||
3952 | int | 3952 | int |
3953 | qla81xx_get_port_config(scsi_qla_host_t *vha, uint16_t *mb) | ||
3954 | { | ||
3955 | int rval; | ||
3956 | mbx_cmd_t mc; | ||
3957 | mbx_cmd_t *mcp = &mc; | ||
3958 | struct qla_hw_data *ha = vha->hw; | ||
3959 | |||
3960 | DEBUG11(printk(KERN_INFO | ||
3961 | "%s(%ld): entered.\n", __func__, vha->host_no)); | ||
3962 | |||
3963 | if (!IS_QLA81XX(ha)) | ||
3964 | return QLA_FUNCTION_FAILED; | ||
3965 | mcp->mb[0] = MBC_GET_PORT_CONFIG; | ||
3966 | mcp->out_mb = MBX_0; | ||
3967 | mcp->in_mb = MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | ||
3968 | mcp->tov = MBX_TOV_SECONDS; | ||
3969 | mcp->flags = 0; | ||
3970 | |||
3971 | rval = qla2x00_mailbox_command(vha, mcp); | ||
3972 | |||
3973 | if (rval != QLA_SUCCESS) { | ||
3974 | DEBUG2_3_11(printk(KERN_WARNING | ||
3975 | "%s(%ld): failed=%x (%x).\n", __func__, | ||
3976 | vha->host_no, rval, mcp->mb[0])); | ||
3977 | } else { | ||
3978 | /* Copy all bits to preserve original value */ | ||
3979 | memcpy(mb, &mcp->mb[1], sizeof(uint16_t) * 4); | ||
3980 | |||
3981 | DEBUG11(printk(KERN_INFO | ||
3982 | "%s(%ld): done.\n", __func__, vha->host_no)); | ||
3983 | } | ||
3984 | return rval; | ||
3985 | } | ||
3986 | |||
3987 | int | ||
3988 | qla81xx_set_port_config(scsi_qla_host_t *vha, uint16_t *mb) | ||
3989 | { | ||
3990 | int rval; | ||
3991 | mbx_cmd_t mc; | ||
3992 | mbx_cmd_t *mcp = &mc; | ||
3993 | |||
3994 | DEBUG11(printk(KERN_INFO | ||
3995 | "%s(%ld): entered.\n", __func__, vha->host_no)); | ||
3996 | |||
3997 | mcp->mb[0] = MBC_SET_PORT_CONFIG; | ||
3998 | /* Copy all bits to preserve original setting */ | ||
3999 | memcpy(&mcp->mb[1], mb, sizeof(uint16_t) * 4); | ||
4000 | mcp->out_mb = MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | ||
4001 | mcp->in_mb = MBX_0; | ||
4002 | mcp->tov = MBX_TOV_SECONDS; | ||
4003 | mcp->flags = 0; | ||
4004 | rval = qla2x00_mailbox_command(vha, mcp); | ||
4005 | |||
4006 | if (rval != QLA_SUCCESS) { | ||
4007 | DEBUG2_3_11(printk(KERN_WARNING | ||
4008 | "%s(%ld): failed=%x (%x).\n", __func__, | ||
4009 | vha->host_no, rval, mcp->mb[0])); | ||
4010 | } else | ||
4011 | DEBUG11(printk(KERN_INFO | ||
4012 | "%s(%ld): done.\n", __func__, vha->host_no)); | ||
4013 | |||
4014 | return rval; | ||
4015 | } | ||
4016 | |||
4017 | |||
4018 | int | ||
3953 | qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority, | 4019 | qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority, |
3954 | uint16_t *mb) | 4020 | uint16_t *mb) |
3955 | { | 4021 | { |