summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/isci.h
diff options
context:
space:
mode:
authorEdmund Nadolski <edmund.nadolski@intel.com>2011-06-02 00:10:50 +0000
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:50 -0700
commit12ef65444de9d387a383b9991960848bed5bbe74 (patch)
treecc7145adf102b57ae4bc347974b23974d795d2c8 /drivers/scsi/isci/isci.h
parente301370ac553a9a0ac0d1d25e769b86cf60395b3 (diff)
isci: additional state machine cleanup
Additional state machine cleanups: o Remove static functions sci_state_machine_exit_state() and sci_state_machine_enter_state() o Combines sci_base_state_machine_construct() and sci_base_state_machine_start() into a single function, sci_init_sm() o Remove sci_base_state_machine_stop() which is unused. o Kill state_machine.[ch] Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> [fixed too large to inline functions] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/isci.h')
-rw-r--r--drivers/scsi/isci/isci.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h
index 2fe5557d859..80cfb45f8da 100644
--- a/drivers/scsi/isci/isci.h
+++ b/drivers/scsi/isci/isci.h
@@ -57,6 +57,7 @@
#define __ISCI_H__
#include <linux/interrupt.h>
+#include <linux/types.h>
#define DRV_NAME "isci"
#define SCI_PCI_BAR_COUNT 2
@@ -584,4 +585,22 @@ static inline void sci_del_timer(struct sci_timer *tmr)
del_timer(&tmr->timer);
}
+struct sci_base_state_machine {
+ const struct sci_base_state *state_table;
+ u32 initial_state_id;
+ u32 current_state_id;
+ u32 previous_state_id;
+};
+
+typedef void (*sci_state_transition_t)(struct sci_base_state_machine *sm);
+
+struct sci_base_state {
+ sci_state_transition_t enter_state; /* Called on state entry */
+ sci_state_transition_t exit_state; /* Called on state exit */
+};
+
+extern void sci_init_sm(struct sci_base_state_machine *sm,
+ const struct sci_base_state *state_table,
+ u32 initial_state);
+extern void sci_change_state(struct sci_base_state_machine *sm, u32 next_state);
#endif /* __ISCI_H__ */