aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_base.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-06-17 04:13:17 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:02:14 -0400
commit570c67ac443dab5c46e5744e950f0539724cb65d (patch)
treedad14200b33f9c0d24c43886b7a88b2a7bf0f2eb /drivers/scsi/mpt2sas/mpt2sas_base.c
parent203d65b16cfef448dbfb79f66b672be4511fc6a9 (diff)
[SCSI] mpt2sas: Added sysfs support for trace buffer
Added support so the diag ring buffer can be pulled via sysfs Added three new shost attributes: host_trace_buffer, host_trace_buffer_enable, and host_trace_buffer_size. The host_trace_buffer_enable attribute is used to either post or release the trace buffers. The host_trace_buffer_size attribute contains the size of the trace buffer. The host_trace_buffer atttribute contains a maximum 4KB window of the buffer. In order to read the entire host buffer, you will need to write the offset to host_trace_buffer prior to reading it. release the host buffer, then write the entire host buffer contents to a file. In addition to this enhancement, we moved the automatic posting of host buffers at driver load time to be called prior to port_enable, instead of after. That way discovery is available in the host buffer. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 88befc798469..93c06239d951 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3529,8 +3529,12 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
3529 if (sleep_flag == CAN_SLEEP) 3529 if (sleep_flag == CAN_SLEEP)
3530 _base_static_config_pages(ioc); 3530 _base_static_config_pages(ioc);
3531 3531
3532 if (ioc->wait_for_port_enable_to_complete && disable_discovery > 0) 3532 if (ioc->wait_for_port_enable_to_complete) {
3533 return r; 3533 if (diag_buffer_enable != 0)
3534 mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable);
3535 if (disable_discovery > 0)
3536 return r;
3537 }
3534 3538
3535 r = _base_send_port_enable(ioc, sleep_flag); 3539 r = _base_send_port_enable(ioc, sleep_flag);
3536 if (r) 3540 if (r)
@@ -3679,8 +3683,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
3679 goto out_free_resources; 3683 goto out_free_resources;
3680 3684
3681 mpt2sas_base_start_watchdog(ioc); 3685 mpt2sas_base_start_watchdog(ioc);
3682 if (diag_buffer_enable != 0)
3683 mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable);
3684 return 0; 3686 return 0;
3685 3687
3686 out_free_resources: 3688 out_free_resources: