diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index effd8a1403d9..e473e9fb363c 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -4125,7 +4125,7 @@ qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority, | |||
4125 | return QLA_FUNCTION_FAILED; | 4125 | return QLA_FUNCTION_FAILED; |
4126 | 4126 | ||
4127 | DEBUG11(printk(KERN_INFO | 4127 | DEBUG11(printk(KERN_INFO |
4128 | "%s(%ld): entered.\n", __func__, ha->host_no)); | 4128 | "%s(%ld): entered.\n", __func__, vha->host_no)); |
4129 | 4129 | ||
4130 | mcp->mb[0] = MBC_PORT_PARAMS; | 4130 | mcp->mb[0] = MBC_PORT_PARAMS; |
4131 | mcp->mb[1] = loop_id; | 4131 | mcp->mb[1] = loop_id; |
@@ -4160,6 +4160,71 @@ qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority, | |||
4160 | } | 4160 | } |
4161 | 4161 | ||
4162 | int | 4162 | int |
4163 | qla2x00_get_thermal_temp(scsi_qla_host_t *vha, uint16_t *temp, uint16_t *frac) | ||
4164 | { | ||
4165 | int rval; | ||
4166 | mbx_cmd_t mc; | ||
4167 | mbx_cmd_t *mcp = &mc; | ||
4168 | struct qla_hw_data *ha = vha->hw; | ||
4169 | |||
4170 | DEBUG11(printk(KERN_INFO "%s(%ld): entered.\n", __func__, ha->host_no)); | ||
4171 | |||
4172 | /* High bits. */ | ||
4173 | mcp->mb[0] = MBC_READ_SFP; | ||
4174 | mcp->mb[1] = 0x98; | ||
4175 | mcp->mb[2] = 0; | ||
4176 | mcp->mb[3] = 0; | ||
4177 | mcp->mb[6] = 0; | ||
4178 | mcp->mb[7] = 0; | ||
4179 | mcp->mb[8] = 1; | ||
4180 | mcp->mb[9] = 0x01; | ||
4181 | mcp->mb[10] = BIT_13|BIT_0; | ||
4182 | mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | ||
4183 | mcp->in_mb = MBX_1|MBX_0; | ||
4184 | mcp->tov = MBX_TOV_SECONDS; | ||
4185 | mcp->flags = 0; | ||
4186 | rval = qla2x00_mailbox_command(vha, mcp); | ||
4187 | if (rval != QLA_SUCCESS) { | ||
4188 | DEBUG2_3_11(printk(KERN_WARNING | ||
4189 | "%s(%ld): failed=%x (%x).\n", __func__, | ||
4190 | vha->host_no, rval, mcp->mb[0])); | ||
4191 | ha->flags.thermal_supported = 0; | ||
4192 | goto fail; | ||
4193 | } | ||
4194 | *temp = mcp->mb[1] & 0xFF; | ||
4195 | |||
4196 | /* Low bits. */ | ||
4197 | mcp->mb[0] = MBC_READ_SFP; | ||
4198 | mcp->mb[1] = 0x98; | ||
4199 | mcp->mb[2] = 0; | ||
4200 | mcp->mb[3] = 0; | ||
4201 | mcp->mb[6] = 0; | ||
4202 | mcp->mb[7] = 0; | ||
4203 | mcp->mb[8] = 1; | ||
4204 | mcp->mb[9] = 0x10; | ||
4205 | mcp->mb[10] = BIT_13|BIT_0; | ||
4206 | mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | ||
4207 | mcp->in_mb = MBX_1|MBX_0; | ||
4208 | mcp->tov = MBX_TOV_SECONDS; | ||
4209 | mcp->flags = 0; | ||
4210 | rval = qla2x00_mailbox_command(vha, mcp); | ||
4211 | if (rval != QLA_SUCCESS) { | ||
4212 | DEBUG2_3_11(printk(KERN_WARNING | ||
4213 | "%s(%ld): failed=%x (%x).\n", __func__, | ||
4214 | vha->host_no, rval, mcp->mb[0])); | ||
4215 | ha->flags.thermal_supported = 0; | ||
4216 | goto fail; | ||
4217 | } | ||
4218 | *frac = ((mcp->mb[1] & 0xFF) >> 6) * 25; | ||
4219 | |||
4220 | if (rval == QLA_SUCCESS) | ||
4221 | DEBUG11(printk(KERN_INFO | ||
4222 | "%s(%ld): done.\n", __func__, ha->host_no)); | ||
4223 | fail: | ||
4224 | return rval; | ||
4225 | } | ||
4226 | |||
4227 | int | ||
4163 | qla82xx_mbx_intr_enable(scsi_qla_host_t *vha) | 4228 | qla82xx_mbx_intr_enable(scsi_qla_host_t *vha) |
4164 | { | 4229 | { |
4165 | int rval; | 4230 | int rval; |