提交 5771710b 编写于 作者: S Swen Schillig 提交者: James Bottomley

[SCSI] zfcp: Update dbf calls

Change the dbf data and functions to use the zfcp_dbf prefix
throughout the code. Also change the calls to dbf to use zfcp_dbf
instead of zfcp_adapter.
Signed-off-by: NSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: NChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 799b76d0
......@@ -517,6 +517,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
goto qdio_mem_failed;
adapter->qdio->adapter = adapter;
ccw_device->handler = NULL;
adapter->ccw_device = ccw_device;
atomic_set(&adapter->refcount, 0);
......@@ -530,7 +531,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
if (zfcp_reqlist_alloc(adapter))
goto failed_low_mem_buffers;
if (zfcp_adapter_debug_register(adapter))
if (zfcp_dbf_adapter_register(adapter))
goto debug_register_failed;
if (zfcp_setup_adapter_work_queue(adapter))
......@@ -577,7 +578,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
sysfs_failed:
zfcp_destroy_adapter_work_queue(adapter);
work_queue_failed:
zfcp_adapter_debug_unregister(adapter);
zfcp_dbf_adapter_unregister(adapter->dbf);
debug_register_failed:
dev_set_drvdata(&ccw_device->dev, NULL);
kfree(adapter->req_list);
......@@ -616,7 +617,7 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
return;
zfcp_destroy_adapter_work_queue(adapter);
zfcp_adapter_debug_unregister(adapter);
zfcp_dbf_adapter_unregister(adapter->dbf);
zfcp_qdio_free(adapter->qdio);
zfcp_free_low_mem_buffers(adapter);
kfree(adapter->req_list);
......
此差异已折叠。
......@@ -37,13 +37,13 @@ struct zfcp_dbf_dump {
u8 data[]; /* dump data */
} __attribute__ ((packed));
struct zfcp_rec_dbf_record_thread {
struct zfcp_dbf_rec_record_thread {
u32 total;
u32 ready;
u32 running;
};
struct zfcp_rec_dbf_record_target {
struct zfcp_dbf_rec_record_target {
u64 ref;
u32 status;
u32 d_id;
......@@ -52,7 +52,7 @@ struct zfcp_rec_dbf_record_target {
u32 erp_count;
};
struct zfcp_rec_dbf_record_trigger {
struct zfcp_dbf_rec_record_trigger {
u8 want;
u8 need;
u32 as;
......@@ -64,21 +64,21 @@ struct zfcp_rec_dbf_record_trigger {
u64 fcp_lun;
};
struct zfcp_rec_dbf_record_action {
struct zfcp_dbf_rec_record_action {
u32 status;
u32 step;
u64 action;
u64 fsf_req;
};
struct zfcp_rec_dbf_record {
struct zfcp_dbf_rec_record {
u8 id;
char id2[7];
union {
struct zfcp_rec_dbf_record_action action;
struct zfcp_rec_dbf_record_thread thread;
struct zfcp_rec_dbf_record_target target;
struct zfcp_rec_dbf_record_trigger trigger;
struct zfcp_dbf_rec_record_action action;
struct zfcp_dbf_rec_record_thread thread;
struct zfcp_dbf_rec_record_target target;
struct zfcp_dbf_rec_record_trigger trigger;
} u;
};
......@@ -89,7 +89,7 @@ enum {
ZFCP_REC_DBF_ID_TRIGGER,
};
struct zfcp_hba_dbf_record_response {
struct zfcp_dbf_hba_record_response {
u32 fsf_command;
u64 fsf_reqid;
u32 fsf_seqno;
......@@ -127,7 +127,7 @@ struct zfcp_hba_dbf_record_response {
} u;
} __attribute__ ((packed));
struct zfcp_hba_dbf_record_status {
struct zfcp_dbf_hba_record_status {
u8 failed;
u32 status_type;
u32 status_subtype;
......@@ -141,24 +141,24 @@ struct zfcp_hba_dbf_record_status {
u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
} __attribute__ ((packed));
struct zfcp_hba_dbf_record_qdio {
struct zfcp_dbf_hba_record_qdio {
u32 qdio_error;
u8 sbal_index;
u8 sbal_count;
} __attribute__ ((packed));
struct zfcp_hba_dbf_record {
struct zfcp_dbf_hba_record {
u8 tag[ZFCP_DBF_TAG_SIZE];
u8 tag2[ZFCP_DBF_TAG_SIZE];
union {
struct zfcp_hba_dbf_record_response response;
struct zfcp_hba_dbf_record_status status;
struct zfcp_hba_dbf_record_qdio qdio;
struct zfcp_dbf_hba_record_response response;
struct zfcp_dbf_hba_record_status status;
struct zfcp_dbf_hba_record_qdio qdio;
struct fsf_bit_error_payload berr;
} u;
} __attribute__ ((packed));
struct zfcp_san_dbf_record_ct_request {
struct zfcp_dbf_san_record_ct_request {
u16 cmd_req_code;
u8 revision;
u8 gs_type;
......@@ -168,7 +168,7 @@ struct zfcp_san_dbf_record_ct_request {
u32 len;
} __attribute__ ((packed));
struct zfcp_san_dbf_record_ct_response {
struct zfcp_dbf_san_record_ct_response {
u16 cmd_rsp_code;
u8 revision;
u8 reason_code;
......@@ -178,27 +178,27 @@ struct zfcp_san_dbf_record_ct_response {
u32 len;
} __attribute__ ((packed));
struct zfcp_san_dbf_record_els {
struct zfcp_dbf_san_record_els {
u8 ls_code;
u32 len;
} __attribute__ ((packed));
struct zfcp_san_dbf_record {
struct zfcp_dbf_san_record {
u8 tag[ZFCP_DBF_TAG_SIZE];
u64 fsf_reqid;
u32 fsf_seqno;
u32 s_id;
u32 d_id;
union {
struct zfcp_san_dbf_record_ct_request ct_req;
struct zfcp_san_dbf_record_ct_response ct_resp;
struct zfcp_san_dbf_record_els els;
struct zfcp_dbf_san_record_ct_request ct_req;
struct zfcp_dbf_san_record_ct_response ct_resp;
struct zfcp_dbf_san_record_els els;
} u;
#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
u8 payload[32];
} __attribute__ ((packed));
struct zfcp_scsi_dbf_record {
struct zfcp_dbf_scsi_record {
u8 tag[ZFCP_DBF_TAG_SIZE];
u8 tag2[ZFCP_DBF_TAG_SIZE];
u32 scsi_id;
......@@ -225,86 +225,84 @@ struct zfcp_scsi_dbf_record {
} __attribute__ ((packed));
struct zfcp_dbf {
debug_info_t *rec_dbf;
debug_info_t *hba_dbf;
debug_info_t *san_dbf;
debug_info_t *scsi_dbf;
spinlock_t rec_dbf_lock;
spinlock_t hba_dbf_lock;
spinlock_t san_dbf_lock;
spinlock_t scsi_dbf_lock;
struct zfcp_rec_dbf_record rec_dbf_buf;
struct zfcp_hba_dbf_record hba_dbf_buf;
struct zfcp_san_dbf_record san_dbf_buf;
struct zfcp_scsi_dbf_record scsi_dbf_buf;
debug_info_t *rec;
debug_info_t *hba;
debug_info_t *san;
debug_info_t *scsi;
spinlock_t rec_lock;
spinlock_t hba_lock;
spinlock_t san_lock;
spinlock_t scsi_lock;
struct zfcp_dbf_rec_record rec_buf;
struct zfcp_dbf_hba_record hba_buf;
struct zfcp_dbf_san_record san_buf;
struct zfcp_dbf_scsi_record scsi_buf;
struct zfcp_adapter *adapter;
};
static inline
void zfcp_hba_dbf_event_fsf_resp(const char *tag2, int level,
struct zfcp_fsf_req *req, struct zfcp_dbf *dbf)
void zfcp_dbf_hba_fsf_resp(const char *tag2, int level,
struct zfcp_fsf_req *req, struct zfcp_dbf *dbf)
{
if (level <= dbf->hba_dbf->level)
_zfcp_hba_dbf_event_fsf_response(tag2, level, req, dbf);
if (level <= dbf->hba->level)
_zfcp_dbf_hba_fsf_response(tag2, level, req, dbf);
}
/**
* zfcp_hba_dbf_event_fsf_response - trace event for request completion
* zfcp_dbf_hba_fsf_response - trace event for request completion
* @fsf_req: request that has been completed
*/
static inline void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *req)
static inline void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req)
{
struct zfcp_dbf *dbf = req->adapter->dbf;
struct fsf_qtcb *qtcb = req->qtcb;
if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) &&
(qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) {
zfcp_hba_dbf_event_fsf_resp("perr", 1, req, dbf);
zfcp_dbf_hba_fsf_resp("perr", 1, req, dbf);
} else if (qtcb->header.fsf_status != FSF_GOOD) {
zfcp_hba_dbf_event_fsf_resp("ferr", 1, req, dbf);
zfcp_dbf_hba_fsf_resp("ferr", 1, req, dbf);
} else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
(req->fsf_command == FSF_QTCB_OPEN_LUN)) {
zfcp_hba_dbf_event_fsf_resp("open", 4, req, dbf);
zfcp_dbf_hba_fsf_resp("open", 4, req, dbf);
} else if (qtcb->header.log_length) {
zfcp_hba_dbf_event_fsf_resp("qtcb", 5, req, dbf);
zfcp_dbf_hba_fsf_resp("qtcb", 5, req, dbf);
} else {
zfcp_hba_dbf_event_fsf_resp("norm", 6, req, dbf);
zfcp_dbf_hba_fsf_resp("norm", 6, req, dbf);
}
}
/**
* zfcp_hba_dbf_event_fsf_unsol - trace event for an unsolicited status buffer
* zfcp_dbf_hba_fsf_unsol - trace event for an unsolicited status buffer
* @tag: tag indicating which kind of unsolicited status has been received
* @adapter: adapter that has issued the unsolicited status buffer
* @dbf: reference to dbf structure
* @status_buffer: buffer containing payload of unsolicited status
*/
static inline
void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
struct fsf_status_read_buffer *buf)
void zfcp_dbf_hba_fsf_unsol(const char *tag, struct zfcp_dbf *dbf,
struct fsf_status_read_buffer *buf)
{
struct zfcp_dbf *dbf = adapter->dbf;
int level = 2;
if (level <= dbf->hba_dbf->level)
_zfcp_hba_dbf_event_fsf_unsol(tag, level, adapter, buf);
if (level <= dbf->hba->level)
_zfcp_dbf_hba_fsf_unsol(tag, level, 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)
void zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
struct zfcp_dbf *dbf, 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);
if (level <= dbf->scsi->level)
_zfcp_dbf_scsi(tag, tag2, level, dbf, scmd, req, old_id);
}
/**
* zfcp_scsi_dbf_event_result - trace event for SCSI command completion
* zfcp_dbf_scsi_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
......@@ -312,16 +310,14 @@ void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
* @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)
void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf,
struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req)
{
zfcp_scsi_dbf_event("rslt", tag, level, adapter, scmd, fsf_req, 0);
zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0);
}
/**
* zfcp_scsi_dbf_event_abort - trace event for SCSI command abort
* zfcp_dbf_scsi_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
......@@ -329,28 +325,26 @@ void zfcp_scsi_dbf_event_result(const char *tag, int level,
* @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)
void zfcp_dbf_scsi_abort(const char *tag, struct zfcp_dbf *dbf,
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_dbf_scsi("abrt", tag, 1, dbf, scmd, new_req, old_id);
}
/**
* zfcp_scsi_dbf_event_devreset - trace event for Logical Unit or Target Reset
* zfcp_dbf_scsi_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)
void zfcp_dbf_scsi_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);
zfcp_dbf_scsi(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1,
unit->port->adapter->dbf, scsi_cmnd, NULL, 0);
}
#endif /* ZFCP_DBF_H */
......@@ -74,9 +74,9 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
struct zfcp_adapter *adapter = act->adapter;
list_move(&act->list, &act->adapter->erp_ready_head);
zfcp_rec_dbf_event_action("erardy1", act);
zfcp_dbf_rec_action("erardy1", act);
up(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread("erardy2", adapter);
zfcp_dbf_rec_thread("erardy2", adapter->dbf);
}
static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act)
......@@ -227,11 +227,10 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter,
++adapter->erp_total_count;
list_add_tail(&act->list, &adapter->erp_ready_head);
up(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread("eracte1", adapter);
zfcp_dbf_rec_thread("eracte1", adapter->dbf);
retval = 0;
out:
zfcp_rec_dbf_event_trigger(id, ref, want, need, act,
adapter, port, unit);
zfcp_dbf_rec_trigger(id, ref, want, need, act, adapter, port, unit);
return retval;
}
......@@ -442,28 +441,28 @@ static int status_change_clear(unsigned long mask, atomic_t *status)
static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter)
{
if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status))
zfcp_rec_dbf_event_adapter("eraubl1", NULL, adapter);
zfcp_dbf_rec_adapter("eraubl1", NULL, adapter->dbf);
atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status);
}
static void zfcp_erp_port_unblock(struct zfcp_port *port)
{
if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status))
zfcp_rec_dbf_event_port("erpubl1", NULL, port);
zfcp_dbf_rec_port("erpubl1", NULL, port);
atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status);
}
static void zfcp_erp_unit_unblock(struct zfcp_unit *unit)
{
if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status))
zfcp_rec_dbf_event_unit("eruubl1", NULL, unit);
zfcp_dbf_rec_unit("eruubl1", NULL, unit);
atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status);
}
static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action)
{
list_move(&erp_action->list, &erp_action->adapter->erp_running_head);
zfcp_rec_dbf_event_action("erator1", erp_action);
zfcp_dbf_rec_action("erator1", erp_action);
}
static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
......@@ -479,11 +478,11 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
if (act->status & (ZFCP_STATUS_ERP_DISMISSED |
ZFCP_STATUS_ERP_TIMEDOUT)) {
act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_rec_dbf_event_action("erscf_1", act);
zfcp_dbf_rec_action("erscf_1", act);
act->fsf_req->erp_action = NULL;
}
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
zfcp_rec_dbf_event_action("erscf_2", act);
zfcp_dbf_rec_action("erscf_2", act);
if (act->fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED)
act->fsf_req = NULL;
} else
......@@ -641,9 +640,9 @@ static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action)
return ZFCP_ERP_FAILED;
}
zfcp_rec_dbf_event_thread_lock("erasfx1", adapter);
zfcp_dbf_rec_thread_lock("erasfx1", adapter->dbf);
down(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock("erasfx2", adapter);
zfcp_dbf_rec_thread_lock("erasfx2", adapter->dbf);
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT)
break;
......@@ -682,9 +681,9 @@ static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act)
if (ret)
return ZFCP_ERP_FAILED;
zfcp_rec_dbf_event_thread_lock("erasox1", adapter);
zfcp_dbf_rec_thread_lock("erasox1", adapter->dbf);
down(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock("erasox2", adapter);
zfcp_dbf_rec_thread_lock("erasox2", adapter->dbf);
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
return ZFCP_ERP_FAILED;
......@@ -1138,7 +1137,7 @@ static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action)
}
list_del(&erp_action->list);
zfcp_rec_dbf_event_action("eractd1", erp_action);
zfcp_dbf_rec_action("eractd1", erp_action);
switch (erp_action->action) {
case ZFCP_ERP_ACTION_REOPEN_UNIT:
......@@ -1297,9 +1296,9 @@ static int zfcp_erp_thread(void *data)
while (!(atomic_read(&adapter->status) &
ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL)) {
zfcp_rec_dbf_event_thread_lock("erthrd1", adapter);
zfcp_dbf_rec_thread_lock("erthrd1", adapter->dbf);
ignore = down_interruptible(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock("erthrd2", adapter);
zfcp_dbf_rec_thread_lock("erthrd2", adapter->dbf);
write_lock_irqsave(&adapter->erp_lock, flags);
next = adapter->erp_ready_head.next;
......@@ -1356,7 +1355,7 @@ void zfcp_erp_thread_kill(struct zfcp_adapter *adapter)
{
atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status);
up(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock("erthrk1", adapter);
zfcp_dbf_rec_thread_lock("erthrk1", adapter->dbf);
wait_event(adapter->erp_thread_wqh,
!(atomic_read(&adapter->status) &
......@@ -1431,11 +1430,11 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id,
if (set_or_clear == ZFCP_SET) {
if (status_change_set(mask, &adapter->status))
zfcp_rec_dbf_event_adapter(id, ref, adapter);
zfcp_dbf_rec_adapter(id, ref, adapter->dbf);
atomic_set_mask(mask, &adapter->status);
} else {
if (status_change_clear(mask, &adapter->status))
zfcp_rec_dbf_event_adapter(id, ref, adapter);
zfcp_dbf_rec_adapter(id, ref, adapter->dbf);
atomic_clear_mask(mask, &adapter->status);
if (mask & ZFCP_STATUS_COMMON_ERP_FAILED)
atomic_set(&adapter->erp_counter, 0);
......@@ -1465,11 +1464,11 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref,
if (set_or_clear == ZFCP_SET) {
if (status_change_set(mask, &port->status))
zfcp_rec_dbf_event_port(id, ref, port);
zfcp_dbf_rec_port(id, ref, port);
atomic_set_mask(mask, &port->status);
} else {
if (status_change_clear(mask, &port->status))
zfcp_rec_dbf_event_port(id, ref, port);
zfcp_dbf_rec_port(id, ref, port);
atomic_clear_mask(mask, &port->status);
if (mask & ZFCP_STATUS_COMMON_ERP_FAILED)
atomic_set(&port->erp_counter, 0);
......@@ -1494,11 +1493,11 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, char *id, void *ref,
{
if (set_or_clear == ZFCP_SET) {
if (status_change_set(mask, &unit->status))
zfcp_rec_dbf_event_unit(id, ref, unit);
zfcp_dbf_rec_unit(id, ref, unit);
atomic_set_mask(mask, &unit->status);
} else {
if (status_change_clear(mask, &unit->status))
zfcp_rec_dbf_event_unit(id, ref, unit);
zfcp_dbf_rec_unit(id, ref, unit);
atomic_clear_mask(mask, &unit->status);
if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) {
atomic_set(&unit->erp_counter, 0);
......
......@@ -34,35 +34,31 @@ extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *);
extern struct miscdevice zfcp_cfdc_misc;
/* zfcp_dbf.c */
extern int zfcp_adapter_debug_register(struct zfcp_adapter *);
extern void zfcp_adapter_debug_unregister(struct zfcp_adapter *);
extern void zfcp_rec_dbf_event_thread(char *, struct zfcp_adapter *);
extern void zfcp_rec_dbf_event_thread_lock(char *, struct zfcp_adapter *);
extern void zfcp_rec_dbf_event_adapter(char *, void *, struct zfcp_adapter *);
extern void zfcp_rec_dbf_event_port(char *, void *, struct zfcp_port *);
extern void zfcp_rec_dbf_event_unit(char *, void *, struct zfcp_unit *);
extern void zfcp_rec_dbf_event_trigger(char *, void *, u8, u8, void *,
struct zfcp_adapter *,
struct zfcp_port *, struct zfcp_unit *);
extern void zfcp_rec_dbf_event_action(char *, struct zfcp_erp_action *);
extern void _zfcp_hba_dbf_event_fsf_response(const char *, int level,
struct zfcp_fsf_req *,
struct zfcp_dbf *dbf);
extern void _zfcp_hba_dbf_event_fsf_unsol(const char *, int level,
struct zfcp_adapter *,
extern int zfcp_dbf_adapter_register(struct zfcp_adapter *);
extern void zfcp_dbf_adapter_unregister(struct zfcp_dbf *);
extern void zfcp_dbf_rec_thread(char *, struct zfcp_dbf *);
extern void zfcp_dbf_rec_thread_lock(char *, struct zfcp_dbf *);
extern void zfcp_dbf_rec_adapter(char *, void *, struct zfcp_dbf *);
extern void zfcp_dbf_rec_port(char *, void *, struct zfcp_port *);
extern void zfcp_dbf_rec_unit(char *, void *, struct zfcp_unit *);
extern void zfcp_dbf_rec_trigger(char *, void *, u8, u8, void *,
struct zfcp_adapter *, struct zfcp_port *,
struct zfcp_unit *);
extern void zfcp_dbf_rec_action(char *, struct zfcp_erp_action *);
extern void _zfcp_dbf_hba_fsf_response(const char *, int, struct zfcp_fsf_req *,
struct zfcp_dbf *);
extern void _zfcp_dbf_hba_fsf_unsol(const char *, int level, struct zfcp_dbf *,
struct fsf_status_read_buffer *);
extern void zfcp_hba_dbf_event_qdio(struct zfcp_qdio *, unsigned int, int,
int);
extern void zfcp_hba_dbf_event_berr(struct zfcp_adapter *,
struct zfcp_fsf_req *);
extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *);
extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *);
extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *);
extern void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *);
extern void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *);
extern void _zfcp_scsi_dbf_event(const char *, const char *, int,
struct zfcp_dbf *, struct scsi_cmnd *,
struct zfcp_fsf_req *, unsigned long);
extern void zfcp_dbf_hba_qdio(struct zfcp_dbf *, unsigned int, int, int);
extern void zfcp_dbf_hba_berr(struct zfcp_dbf *, struct zfcp_fsf_req *);
extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_els_request(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_els_response(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *);
extern void _zfcp_dbf_scsi(const char *, const char *, int, struct zfcp_dbf *,
struct scsi_cmnd *, struct zfcp_fsf_req *,
unsigned long);
/* zfcp_erp.c */
extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, char *,
......
......@@ -242,7 +242,7 @@ void zfcp_fc_incoming_els(struct zfcp_fsf_req *fsf_req)
(struct fsf_status_read_buffer *) fsf_req->data;
unsigned int els_type = status_buffer->payload.data[0];
zfcp_san_dbf_event_incoming_els(fsf_req);
zfcp_dbf_san_incoming_els(fsf_req);
if (els_type == LS_PLOGI)
zfcp_fc_incoming_plogi(fsf_req);
else if (els_type == LS_LOGO)
......
......@@ -248,13 +248,13 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
struct fsf_status_read_buffer *sr_buf = req->data;
if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
zfcp_hba_dbf_event_fsf_unsol("dism", adapter, sr_buf);
zfcp_dbf_hba_fsf_unsol("dism", adapter->dbf, sr_buf);
mempool_free(sr_buf, adapter->pool.status_read_data);
zfcp_fsf_req_free(req);
return;
}
zfcp_hba_dbf_event_fsf_unsol("read", adapter, sr_buf);
zfcp_dbf_hba_fsf_unsol("read", adapter->dbf, sr_buf);
switch (sr_buf->status_type) {
case FSF_STATUS_READ_PORT_CLOSED:
......@@ -269,7 +269,7 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
dev_warn(&adapter->ccw_device->dev,
"The error threshold for checksum statistics "
"has been exceeded\n");
zfcp_hba_dbf_event_berr(adapter, req);
zfcp_dbf_hba_berr(adapter->dbf, req);
break;
case FSF_STATUS_READ_LINK_DOWN:
zfcp_fsf_status_read_link_down(req);
......@@ -355,7 +355,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
struct fsf_qtcb *qtcb = req->qtcb;
union fsf_prot_status_qual *psq = &qtcb->prefix.prot_status_qual;
zfcp_hba_dbf_event_fsf_response(req);
zfcp_dbf_hba_fsf_response(req);
if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
......@@ -848,7 +848,7 @@ int zfcp_fsf_status_read(struct zfcp_qdio *qdio)
mempool_free(sr_buf, adapter->pool.status_read_data);
failed_buf:
zfcp_fsf_req_free(req);
zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL);
zfcp_dbf_hba_fsf_unsol("fail", adapter->dbf, NULL);
out:
spin_unlock_bh(&qdio->req_q_lock);
return retval;
......@@ -968,7 +968,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
switch (header->fsf_status) {
case FSF_GOOD:
zfcp_san_dbf_event_ct_response(req);
zfcp_dbf_san_ct_response(req);
send_ct->status = 0;
break;
case FSF_SERVICE_CLASS_NOT_SUPPORTED:
......@@ -1100,7 +1100,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool)
req->qtcb->bottom.support.timeout = ct->timeout;
req->data = ct;
zfcp_san_dbf_event_ct_request(req);
zfcp_dbf_san_ct_request(req);
zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
ret = zfcp_fsf_req_send(req);
......@@ -1129,7 +1129,7 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
switch (header->fsf_status) {
case FSF_GOOD:
zfcp_san_dbf_event_els_response(req);
zfcp_dbf_san_els_response(req);
send_els->status = 0;
break;
case FSF_SERVICE_CLASS_NOT_SUPPORTED:
......@@ -1203,7 +1203,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els)
bottom->timeout = 2 * R_A_TOV;
req->data = els;
zfcp_san_dbf_event_els_request(req);
zfcp_dbf_san_els_request(req);
zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
ret = zfcp_fsf_req_send(req);
......@@ -2213,11 +2213,11 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
}
skip_fsfstatus:
if (scpnt->result != 0)
zfcp_scsi_dbf_event_result("erro", 3, req->adapter, scpnt, req);
zfcp_dbf_scsi_result("erro", 3, req->adapter->dbf, scpnt, req);
else if (scpnt->retries > 0)
zfcp_scsi_dbf_event_result("retr", 4, req->adapter, scpnt, req);
zfcp_dbf_scsi_result("retr", 4, req->adapter->dbf, scpnt, req);
else
zfcp_scsi_dbf_event_result("norm", 6, req->adapter, scpnt, req);
zfcp_dbf_scsi_result("norm", 6, req->adapter->dbf, scpnt, req);
scpnt->host_scribble = NULL;
(scpnt->scsi_done) (scpnt);
......
......@@ -101,7 +101,8 @@ static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err,
struct zfcp_qdio_queue *queue = &qdio->req_q;
if (unlikely(qdio_err)) {
zfcp_hba_dbf_event_qdio(qdio, qdio_err, first, count);
zfcp_dbf_hba_qdio(qdio->adapter->dbf, qdio_err, first,
count);
zfcp_qdio_handler_error(qdio, "qdireq1");
return;
}
......@@ -143,7 +144,8 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
int sbal_idx, sbal_no;
if (unlikely(qdio_err)) {
zfcp_hba_dbf_event_qdio(qdio, qdio_err, first, count);
zfcp_dbf_hba_qdio(qdio->adapter->dbf, qdio_err, first,
count);
zfcp_qdio_handler_error(qdio, "qdires1");
return;
}
......
......@@ -53,11 +53,11 @@ static int zfcp_scsi_slave_configure(struct scsi_device *sdp)
static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
{
struct zfcp_adapter *adapter =
(struct zfcp_adapter *) scpnt->device->host->hostdata[0];
set_host_byte(scpnt, result);
if ((scpnt->device != NULL) && (scpnt->device->host != NULL))
zfcp_scsi_dbf_event_result("fail", 4,
(struct zfcp_adapter*) scpnt->device->host->hostdata[0],
scpnt, NULL);
zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL);
/* return directly */
scpnt->scsi_done(scpnt);
}
......@@ -93,7 +93,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
scsi_result = fc_remote_port_chkready(rport);
if (unlikely(scsi_result)) {
scpnt->result = scsi_result;
zfcp_scsi_dbf_event_result("fail", 4, adapter, scpnt, NULL);
zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL);
scpnt->scsi_done(scpnt);
return 0;
}
......@@ -181,8 +181,8 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
spin_unlock(&adapter->req_list_lock);
if (!old_req) {
write_unlock_irqrestore(&adapter->abort_lock, flags);
zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL,
old_reqid);
zfcp_dbf_scsi_abort("lte1", adapter->dbf, scpnt, NULL,
old_reqid);
return FAILED; /* completion could be in progress */
}
old_req->data = NULL;
......@@ -198,8 +198,8 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
zfcp_erp_wait(adapter);
if (!(atomic_read(&adapter->status) &
ZFCP_STATUS_COMMON_RUNNING)) {
zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL,
old_reqid);
zfcp_dbf_scsi_abort("nres", adapter->dbf, scpnt, NULL,
old_reqid);
return SUCCESS;
}
}
......@@ -216,7 +216,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
dbf_tag = "fail";
retval = FAILED;
}
zfcp_scsi_dbf_event_abort(dbf_tag, adapter, scpnt, abrt_req, old_reqid);
zfcp_dbf_scsi_abort(dbf_tag, adapter->dbf, scpnt, abrt_req, old_reqid);
zfcp_fsf_req_free(abrt_req);
return retval;
}
......@@ -237,8 +237,7 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags)
zfcp_erp_wait(adapter);
if (!(atomic_read(&adapter->status) &
ZFCP_STATUS_COMMON_RUNNING)) {
zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit,
scpnt);
zfcp_dbf_scsi_devreset("nres", tm_flags, unit, scpnt);
return SUCCESS;
}
}
......@@ -248,13 +247,13 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags)
wait_for_completion(&fsf_req->completion);
if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) {
zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt);
zfcp_dbf_scsi_devreset("fail", tm_flags, unit, scpnt);
retval = FAILED;
} else if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP) {
zfcp_scsi_dbf_event_devreset("nsup", tm_flags, unit, scpnt);
zfcp_dbf_scsi_devreset("nsup", tm_flags, unit, scpnt);
retval = FAILED;
} else
zfcp_scsi_dbf_event_devreset("okay", tm_flags, unit, scpnt);
zfcp_dbf_scsi_devreset("okay", tm_flags, unit, scpnt);
zfcp_fsf_req_free(fsf_req);
return retval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册