aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2008-04-03 16:13:19 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:13 -0400
commitcb8dacbf1110d8bd39413f3116ff1720f757854e (patch)
tree8d58f215c7a1091f7e760359c56d1316d9c80f7d /drivers/scsi/qla2xxx/qla_os.c
parent0971de7f56f809f40edae6fd372745e429e970e9 (diff)
[SCSI] qla2xxx: Add hardware trace-logging support.
Recent ISPs have a region within FLASH which acts as a repository for the logging of serious hardware and software failures. Currently, the region is large enough to support up to 255 entries. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index eb77067533ab..3d290417bfc6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1690,6 +1690,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1690 ha->gid_list_info_size = 8; 1690 ha->gid_list_info_size = 8;
1691 ha->optrom_size = OPTROM_SIZE_25XX; 1691 ha->optrom_size = OPTROM_SIZE_25XX;
1692 ha->isp_ops = &qla25xx_isp_ops; 1692 ha->isp_ops = &qla25xx_isp_ops;
1693 ha->hw_event_start = PCI_FUNC(pdev->devfn) ?
1694 FA_HW_EVENT1_ADDR: FA_HW_EVENT0_ADDR;
1693 } 1695 }
1694 host->can_queue = ha->request_q_length + 128; 1696 host->can_queue = ha->request_q_length + 128;
1695 1697
@@ -2244,6 +2246,23 @@ qla2x00_post_aen_work(struct scsi_qla_host *ha, enum fc_host_event_code code,
2244 return qla2x00_post_work(ha, e, 1); 2246 return qla2x00_post_work(ha, e, 1);
2245} 2247}
2246 2248
2249int
2250qla2x00_post_hwe_work(struct scsi_qla_host *ha, uint16_t code, uint16_t d1,
2251 uint16_t d2, uint16_t d3)
2252{
2253 struct qla_work_evt *e;
2254
2255 e = qla2x00_alloc_work(ha, QLA_EVT_HWE_LOG, 1);
2256 if (!e)
2257 return QLA_FUNCTION_FAILED;
2258
2259 e->u.hwe.code = code;
2260 e->u.hwe.d1 = d1;
2261 e->u.hwe.d2 = d2;
2262 e->u.hwe.d3 = d3;
2263 return qla2x00_post_work(ha, e, 1);
2264}
2265
2247static void 2266static void
2248qla2x00_do_work(struct scsi_qla_host *ha) 2267qla2x00_do_work(struct scsi_qla_host *ha)
2249{ 2268{
@@ -2260,6 +2279,10 @@ qla2x00_do_work(struct scsi_qla_host *ha)
2260 fc_host_post_event(ha->host, fc_get_event_number(), 2279 fc_host_post_event(ha->host, fc_get_event_number(),
2261 e->u.aen.code, e->u.aen.data); 2280 e->u.aen.code, e->u.aen.data);
2262 break; 2281 break;
2282 case QLA_EVT_HWE_LOG:
2283 qla2xxx_hw_event_log(ha, e->u.hwe.code, e->u.hwe.d1,
2284 e->u.hwe.d2, e->u.hwe.d3);
2285 break;
2263 } 2286 }
2264 if (e->flags & QLA_EVT_FLAG_FREE) 2287 if (e->flags & QLA_EVT_FLAG_FREE)
2265 kfree(e); 2288 kfree(e);