summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_inline.h
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@qlogic.com>2011-03-30 22:46:32 +0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 19:14:42 +0400
commitec426e106c410b000ac590b6e776d5a6cd9bccd9 (patch)
tree214b0e2c5935b2ea2143bf993b86799429427f70 /drivers/scsi/qla2xxx/qla_inline.h
parenta4f92a32a0fb827f7bd40c69f021cf57d3dc4249 (diff)
downloadlinux-ec426e106c410b000ac590b6e776d5a6cd9bccd9.tar.xz
[SCSI] qla2xxx: Log fcport state transitions when debug messages are enabled.
Add the inline function qla2x00_set_port_state() so that when a fcport state transition happens we can log the state transition if debug messages are enabled. Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_inline.h')
-rw-r--r--drivers/scsi/qla2xxx/qla_inline.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index 4d17e7018aa3..4c8167e11f69 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -83,3 +83,22 @@ qla2x00_clean_dsd_pool(struct qla_hw_data *ha, srb_t *sp)
}
INIT_LIST_HEAD(&((struct crc_context *)sp->ctx)->dsd_list);
}
+
+static inline void
+qla2x00_set_fcport_state(fc_port_t *fcport, int state)
+{
+ int old_state;
+
+ old_state = atomic_read(&fcport->state);
+ atomic_set(&fcport->state, state);
+
+ /* Don't print state transitions during initial allocation of fcport */
+ if (old_state && old_state != state) {
+ DEBUG(qla_printk(KERN_WARNING, fcport->vha->hw,
+ "scsi(%ld): FCPort state transitioned from %s to %s - "
+ "portid=%02x%02x%02x.\n", fcport->vha->host_no,
+ port_state_str[old_state], port_state_str[state],
+ fcport->d_id.b.domain, fcport->d_id.b.area,
+ fcport->d_id.b.al_pa));
+ }
+}