aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/scsi/zfcp_dbf.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.h')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index 4cfd68fe8a26..c2d5ef18b73a 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -22,7 +22,9 @@
#ifndef ZFCP_DBF_H
#define ZFCP_DBF_H
+#include "zfcp_ext.h"
#include "zfcp_fsf.h"
+#include "zfcp_def.h"
#define ZFCP_DBF_TAG_SIZE 4
#define ZFCP_DBF_ID_SIZE 7
@@ -237,4 +239,65 @@ struct zfcp_dbf {
struct zfcp_scsi_dbf_record scsi_dbf_buf;
};
+static inline
+void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
+ struct zfcp_adapter *adapter, struct scsi_cmnd *scmd,
+ struct zfcp_fsf_req *req, unsigned long old_id)
+{
+ struct zfcp_dbf *dbf = adapter->dbf;
+
+ if (level <= dbf->scsi_dbf->level)
+ _zfcp_scsi_dbf_event(tag, tag2, level, dbf, scmd, req, old_id);
+}
+
+/**
+ * zfcp_scsi_dbf_event_result - trace event for SCSI command completion
+ * @tag: tag indicating success or failure of SCSI command
+ * @level: trace level applicable for this event
+ * @adapter: adapter that has been used to issue the SCSI command
+ * @scmd: SCSI command pointer
+ * @fsf_req: request used to issue SCSI command (might be NULL)
+ */
+static inline
+void zfcp_scsi_dbf_event_result(const char *tag, int level,
+ struct zfcp_adapter *adapter,
+ struct scsi_cmnd *scmd,
+ struct zfcp_fsf_req *fsf_req)
+{
+ zfcp_scsi_dbf_event("rslt", tag, level, adapter, scmd, fsf_req, 0);
+}
+
+/**
+ * zfcp_scsi_dbf_event_abort - trace event for SCSI command abort
+ * @tag: tag indicating success or failure of abort operation
+ * @adapter: adapter thas has been used to issue SCSI command to be aborted
+ * @scmd: SCSI command to be aborted
+ * @new_req: request containing abort (might be NULL)
+ * @old_id: identifier of request containg SCSI command to be aborted
+ */
+static inline
+void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter,
+ struct scsi_cmnd *scmd,
+ struct zfcp_fsf_req *new_req,
+ unsigned long old_id)
+{
+ zfcp_scsi_dbf_event("abrt", tag, 1, adapter, scmd, new_req, old_id);
+}
+
+/**
+ * zfcp_scsi_dbf_event_devreset - trace event for Logical Unit or Target Reset
+ * @tag: tag indicating success or failure of reset operation
+ * @flag: indicates type of reset (Target Reset, Logical Unit Reset)
+ * @unit: unit that needs reset
+ * @scsi_cmnd: SCSI command which caused this error recovery
+ */
+static inline
+void zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag,
+ struct zfcp_unit *unit,
+ struct scsi_cmnd *scsi_cmnd)
+{
+ zfcp_scsi_dbf_event(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1,
+ unit->port->adapter, scsi_cmnd, NULL, 0);
+}
+
#endif /* ZFCP_DBF_H */