aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorandrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com>2006-03-09 17:27:13 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-12 10:38:03 -0500
commit044cc6c8ec311c4ddeebfcc31c53dea282de70b7 (patch)
tree891078bdbf9c8673d2408215c80551dc4a015f6d /drivers/scsi/qla2xxx/qla_mbx.c
parentea5b6382fde00e0dbcd0de2e4aa2fd15705e5fc3 (diff)
[SCSI] qla2xxx: Add ISP54xx support.
Chip is similar in form to our ISP24xx offering. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 584cc2f6dd35..267435f17482 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -91,7 +91,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
91 spin_lock_irqsave(&ha->hardware_lock, flags); 91 spin_lock_irqsave(&ha->hardware_lock, flags);
92 92
93 /* Load mailbox registers. */ 93 /* Load mailbox registers. */
94 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) 94 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
95 optr = (uint16_t __iomem *)&reg->isp24.mailbox0; 95 optr = (uint16_t __iomem *)&reg->isp24.mailbox0;
96 else 96 else
97 optr = (uint16_t __iomem *)MAILBOX_REG(ha, &reg->isp, 0); 97 optr = (uint16_t __iomem *)MAILBOX_REG(ha, &reg->isp, 0);
@@ -155,7 +155,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
155 155
156 set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); 156 set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
157 157
158 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) 158 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
159 WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT); 159 WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT);
160 else 160 else
161 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT); 161 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT);
@@ -179,7 +179,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
179 DEBUG3_11(printk("%s(%ld): cmd=%x POLLING MODE.\n", __func__, 179 DEBUG3_11(printk("%s(%ld): cmd=%x POLLING MODE.\n", __func__,
180 ha->host_no, command);) 180 ha->host_no, command);)
181 181
182 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) 182 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
183 WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT); 183 WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_SET_HOST_INT);
184 else 184 else
185 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT); 185 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT);
@@ -237,7 +237,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
237 uint16_t mb0; 237 uint16_t mb0;
238 uint32_t ictrl; 238 uint32_t ictrl;
239 239
240 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 240 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
241 mb0 = RD_REG_WORD(&reg->isp24.mailbox0); 241 mb0 = RD_REG_WORD(&reg->isp24.mailbox0);
242 ictrl = RD_REG_DWORD(&reg->isp24.ictrl); 242 ictrl = RD_REG_DWORD(&reg->isp24.ictrl);
243 } else { 243 } else {
@@ -334,7 +334,7 @@ qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr,
334 334
335 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 335 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
336 336
337 if (MSW(risc_addr) || IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 337 if (MSW(risc_addr) || IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
338 mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED; 338 mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED;
339 mcp->mb[8] = MSW(risc_addr); 339 mcp->mb[8] = MSW(risc_addr);
340 mcp->out_mb = MBX_8|MBX_0; 340 mcp->out_mb = MBX_8|MBX_0;
@@ -348,7 +348,7 @@ qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr,
348 mcp->mb[6] = MSW(MSD(req_dma)); 348 mcp->mb[6] = MSW(MSD(req_dma));
349 mcp->mb[7] = LSW(MSD(req_dma)); 349 mcp->mb[7] = LSW(MSD(req_dma));
350 mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1; 350 mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1;
351 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 351 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
352 mcp->mb[4] = MSW(risc_code_size); 352 mcp->mb[4] = MSW(risc_code_size);
353 mcp->mb[5] = LSW(risc_code_size); 353 mcp->mb[5] = LSW(risc_code_size);
354 mcp->out_mb |= MBX_5|MBX_4; 354 mcp->out_mb |= MBX_5|MBX_4;
@@ -399,7 +399,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr)
399 mcp->mb[0] = MBC_EXECUTE_FIRMWARE; 399 mcp->mb[0] = MBC_EXECUTE_FIRMWARE;
400 mcp->out_mb = MBX_0; 400 mcp->out_mb = MBX_0;
401 mcp->in_mb = MBX_0; 401 mcp->in_mb = MBX_0;
402 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 402 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
403 mcp->mb[1] = MSW(risc_addr); 403 mcp->mb[1] = MSW(risc_addr);
404 mcp->mb[2] = LSW(risc_addr); 404 mcp->mb[2] = LSW(risc_addr);
405 mcp->mb[3] = 0; 405 mcp->mb[3] = 0;
@@ -422,7 +422,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr)
422 DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x.\n", __func__, 422 DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x.\n", __func__,
423 ha->host_no, rval, mcp->mb[0])); 423 ha->host_no, rval, mcp->mb[0]));
424 } else { 424 } else {
425 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 425 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
426 DEBUG11(printk("%s(%ld): done exchanges=%x.\n", 426 DEBUG11(printk("%s(%ld): done exchanges=%x.\n",
427 __func__, ha->host_no, mcp->mb[1]);) 427 __func__, ha->host_no, mcp->mb[1]);)
428 } else { 428 } else {
@@ -563,7 +563,7 @@ qla2x00_set_fw_options(scsi_qla_host_t *ha, uint16_t *fwopts)
563 mcp->mb[3] = fwopts[3]; 563 mcp->mb[3] = fwopts[3];
564 mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; 564 mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0;
565 mcp->in_mb = MBX_0; 565 mcp->in_mb = MBX_0;
566 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 566 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
567 mcp->in_mb |= MBX_1; 567 mcp->in_mb |= MBX_1;
568 } else { 568 } else {
569 mcp->mb[10] = fwopts[10]; 569 mcp->mb[10] = fwopts[10];
@@ -676,7 +676,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr)
676 mcp->mb[0] = MBC_VERIFY_CHECKSUM; 676 mcp->mb[0] = MBC_VERIFY_CHECKSUM;
677 mcp->out_mb = MBX_0; 677 mcp->out_mb = MBX_0;
678 mcp->in_mb = MBX_0; 678 mcp->in_mb = MBX_0;
679 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 679 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
680 mcp->mb[1] = MSW(risc_addr); 680 mcp->mb[1] = MSW(risc_addr);
681 mcp->mb[2] = LSW(risc_addr); 681 mcp->mb[2] = LSW(risc_addr);
682 mcp->out_mb |= MBX_2|MBX_1; 682 mcp->out_mb |= MBX_2|MBX_1;
@@ -693,7 +693,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr)
693 693
694 if (rval != QLA_SUCCESS) { 694 if (rval != QLA_SUCCESS) {
695 DEBUG2_3_11(printk("%s(%ld): failed=%x chk sum=%x.\n", __func__, 695 DEBUG2_3_11(printk("%s(%ld): failed=%x chk sum=%x.\n", __func__,
696 ha->host_no, rval, (IS_QLA24XX(ha) || IS_QLA25XX(ha) ? 696 ha->host_no, rval, (IS_QLA24XX(ha) || IS_QLA54XX(ha) ?
697 (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1]));) 697 (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1]));)
698 } else { 698 } else {
699 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) 699 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);)
@@ -751,7 +751,7 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr,
751 751
752 /* Mask reserved bits. */ 752 /* Mask reserved bits. */
753 sts_entry->entry_status &= 753 sts_entry->entry_status &=
754 IS_QLA24XX(ha) || IS_QLA25XX(ha) ? RF_MASK_24XX :RF_MASK; 754 IS_QLA24XX(ha) || IS_QLA54XX(ha) ? RF_MASK_24XX :RF_MASK;
755 } 755 }
756 756
757 return rval; 757 return rval;
@@ -1091,7 +1091,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
1091 memset(pd, 0, max(PORT_DATABASE_SIZE, PORT_DATABASE_24XX_SIZE)); 1091 memset(pd, 0, max(PORT_DATABASE_SIZE, PORT_DATABASE_24XX_SIZE));
1092 1092
1093 mcp->mb[0] = MBC_GET_PORT_DATABASE; 1093 mcp->mb[0] = MBC_GET_PORT_DATABASE;
1094 if (opt != 0 && !IS_QLA24XX(ha) && !IS_QLA25XX(ha)) 1094 if (opt != 0 && !IS_QLA24XX(ha) && !IS_QLA54XX(ha))
1095 mcp->mb[0] = MBC_ENHANCED_GET_PORT_DATABASE; 1095 mcp->mb[0] = MBC_ENHANCED_GET_PORT_DATABASE;
1096 mcp->mb[2] = MSW(pd_dma); 1096 mcp->mb[2] = MSW(pd_dma);
1097 mcp->mb[3] = LSW(pd_dma); 1097 mcp->mb[3] = LSW(pd_dma);
@@ -1099,7 +1099,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
1099 mcp->mb[7] = LSW(MSD(pd_dma)); 1099 mcp->mb[7] = LSW(MSD(pd_dma));
1100 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; 1100 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
1101 mcp->in_mb = MBX_0; 1101 mcp->in_mb = MBX_0;
1102 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 1102 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
1103 mcp->mb[1] = fcport->loop_id; 1103 mcp->mb[1] = fcport->loop_id;
1104 mcp->mb[10] = opt; 1104 mcp->mb[10] = opt;
1105 mcp->out_mb |= MBX_10|MBX_1; 1105 mcp->out_mb |= MBX_10|MBX_1;
@@ -1112,7 +1112,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
1112 mcp->mb[1] = fcport->loop_id << 8 | opt; 1112 mcp->mb[1] = fcport->loop_id << 8 | opt;
1113 mcp->out_mb |= MBX_1; 1113 mcp->out_mb |= MBX_1;
1114 } 1114 }
1115 mcp->buf_size = (IS_QLA24XX(ha) || IS_QLA25XX(ha) ? 1115 mcp->buf_size = (IS_QLA24XX(ha) || IS_QLA54XX(ha) ?
1116 PORT_DATABASE_24XX_SIZE : PORT_DATABASE_SIZE); 1116 PORT_DATABASE_24XX_SIZE : PORT_DATABASE_SIZE);
1117 mcp->flags = MBX_DMA_IN; 1117 mcp->flags = MBX_DMA_IN;
1118 mcp->tov = (ha->login_timeout * 2) + (ha->login_timeout / 2); 1118 mcp->tov = (ha->login_timeout * 2) + (ha->login_timeout / 2);
@@ -1120,7 +1120,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
1120 if (rval != QLA_SUCCESS) 1120 if (rval != QLA_SUCCESS)
1121 goto gpd_error_out; 1121 goto gpd_error_out;
1122 1122
1123 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 1123 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
1124 pd24 = (struct port_database_24xx *) pd; 1124 pd24 = (struct port_database_24xx *) pd;
1125 1125
1126 /* Check for logged in state. */ 1126 /* Check for logged in state. */
@@ -1337,7 +1337,7 @@ qla2x00_lip_reset(scsi_qla_host_t *ha)
1337 1337
1338 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) 1338 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
1339 1339
1340 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 1340 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
1341 mcp->mb[0] = MBC_LIP_FULL_LOGIN; 1341 mcp->mb[0] = MBC_LIP_FULL_LOGIN;
1342 mcp->mb[1] = BIT_0; 1342 mcp->mb[1] = BIT_0;
1343 mcp->mb[2] = 0xff; 1343 mcp->mb[2] = 0xff;
@@ -1866,7 +1866,7 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma,
1866 1866
1867 mcp->mb[0] = MBC_GET_ID_LIST; 1867 mcp->mb[0] = MBC_GET_ID_LIST;
1868 mcp->out_mb = MBX_0; 1868 mcp->out_mb = MBX_0;
1869 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 1869 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
1870 mcp->mb[2] = MSW(id_list_dma); 1870 mcp->mb[2] = MSW(id_list_dma);
1871 mcp->mb[3] = LSW(id_list_dma); 1871 mcp->mb[3] = LSW(id_list_dma);
1872 mcp->mb[6] = MSW(MSD(id_list_dma)); 1872 mcp->mb[6] = MSW(MSD(id_list_dma));
@@ -2057,7 +2057,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
2057 mcp->mb[7] = LSW(MSD(stat_buf_dma)); 2057 mcp->mb[7] = LSW(MSD(stat_buf_dma));
2058 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; 2058 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
2059 mcp->in_mb = MBX_0; 2059 mcp->in_mb = MBX_0;
2060 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 2060 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
2061 mcp->mb[1] = loop_id; 2061 mcp->mb[1] = loop_id;
2062 mcp->mb[4] = 0; 2062 mcp->mb[4] = 0;
2063 mcp->mb[10] = 0; 2063 mcp->mb[10] = 0;
@@ -2324,7 +2324,7 @@ qla2x00_system_error(scsi_qla_host_t *ha)
2324 mbx_cmd_t mc; 2324 mbx_cmd_t mc;
2325 mbx_cmd_t *mcp = &mc; 2325 mbx_cmd_t *mcp = &mc;
2326 2326
2327 if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) 2327 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
2328 return QLA_FUNCTION_FAILED; 2328 return QLA_FUNCTION_FAILED;
2329 2329
2330 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 2330 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
@@ -2434,7 +2434,7 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha)
2434 mbx_cmd_t mc; 2434 mbx_cmd_t mc;
2435 mbx_cmd_t *mcp = &mc; 2435 mbx_cmd_t *mcp = &mc;
2436 2436
2437 if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) 2437 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
2438 return QLA_FUNCTION_FAILED; 2438 return QLA_FUNCTION_FAILED;
2439 2439
2440 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 2440 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));