aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/isci.h
diff options
context:
space:
mode:
authorEdmund Nadolski <edmund.nadolski@intel.com>2011-06-01 20:10:50 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:50 -0400
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 2fe5557d8590..80cfb45f8da1 100644
--- a/drivers/scsi/isci/isci.h
+++ b/drivers/scsi/isci/isci.h
@@ -57,6 +57,7 @@
57#define __ISCI_H__ 57#define __ISCI_H__
58 58
59#include <linux/interrupt.h> 59#include <linux/interrupt.h>
60#include <linux/types.h>
60 61
61#define DRV_NAME "isci" 62#define DRV_NAME "isci"
62#define SCI_PCI_BAR_COUNT 2 63#define SCI_PCI_BAR_COUNT 2
@@ -584,4 +585,22 @@ static inline void sci_del_timer(struct sci_timer *tmr)
584 del_timer(&tmr->timer); 585 del_timer(&tmr->timer);
585} 586}
586 587
588struct sci_base_state_machine {
589 const struct sci_base_state *state_table;
590 u32 initial_state_id;
591 u32 current_state_id;
592 u32 previous_state_id;
593};
594
595typedef void (*sci_state_transition_t)(struct sci_base_state_machine *sm);
596
597struct sci_base_state {
598 sci_state_transition_t enter_state; /* Called on state entry */
599 sci_state_transition_t exit_state; /* Called on state exit */
600};
601
602extern void sci_init_sm(struct sci_base_state_machine *sm,
603 const struct sci_base_state *state_table,
604 u32 initial_state);
605extern void sci_change_state(struct sci_base_state_machine *sm, u32 next_state);
587#endif /* __ISCI_H__ */ 606#endif /* __ISCI_H__ */