summaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/timers.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-03-02 19:49:26 (GMT)
committerDan Williams <dan.j.williams@intel.com>2011-07-03 10:55:28 (GMT)
commit7c40a8035815479c7c12ab0cdcea71e0f4c3a9c8 (patch)
tree43290f7b96374f0ff8e80ad5e8620f3dc8242f1a /drivers/scsi/isci/timers.h
parent150fc6fc725055b400a8865e6785dc8dd0a2225d (diff)
downloadlinux-fsl-qoriq-7c40a8035815479c7c12ab0cdcea71e0f4c3a9c8.tar.xz
isci: rework timer api
Prepare the timer api for the arrival of dynamic creation and destruction events from the core. It pretended to do this previously but the core to date only used it in a static init-time only fashion. This is an interim fix until a cleaner event queue can be developed. 1/ make all locking external to the api (add WARN_ONCE to verify) 2/ add a timer_destroy interface (to be used by the core) 3/ use del_timer_sync() prior to deallocating timer data 4/ delete the "timer_list" indirection, we only have timers allocated for the isci_host 5/ fix detection of timer list allocation errors Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/timers.h')
-rw-r--r--drivers/scsi/isci/timers.h60
1 files changed, 11 insertions, 49 deletions
diff --git a/drivers/scsi/isci/timers.h b/drivers/scsi/isci/timers.h
index ca5c215..8d8a892 100644
--- a/drivers/scsi/isci/timers.h
+++ b/drivers/scsi/isci/timers.h
@@ -59,68 +59,30 @@
#include <linux/timer.h>
#include <linux/types.h>
-/***************************************************
- * isci_timer
- ***************************************************
- */
-/**
- * struct isci_timer_list - This class is the container for all isci_timer
- * objects
- *
- *
- */
-struct isci_timer_list {
-
- struct list_head timers;
-};
+#define SCI_MAX_TIMER_COUNT 25
/**
* struct isci_timer - This class represents the timer object used by SCIC. It
- * wraps the Linux timer_list object.
- *
+ * wraps the Linux timer_list object, and (TODO) should be removed in favor
+ * of a delayed-workqueue style interface with simpler locking
*
*/
struct isci_timer {
int used;
int stopped;
- int restart;
- int timeout_value;
- void *cookie;
+ void *cb_param;
void (*timer_callback)(void *);
struct list_head node;
struct timer_list timer;
- struct isci_timer_list *parent;
struct isci_host *isci_host;
};
-#define to_isci_timer(t) \
- container_of(t, struct isci_timer, timer);
-
-int isci_timer_list_construct(
- struct isci_timer_list *isci_timer_list,
- int timer_list_size);
-
-
-int isci_timer_list_destroy(
- struct isci_timer_list *isci_timer_list);
-
-struct isci_timer *isci_timer_create(
- struct isci_timer_list *isci_timer_list,
- struct isci_host *isci_host,
- void *cookie,
- void (*timer_callback)(void *));
-
-void isci_timer_free(
- struct isci_timer_list *isci_timer_list,
- struct isci_timer *isci_timer);
-
-void isci_timer_start(
- struct isci_timer *isci_timer,
- unsigned long timeout);
-
-void isci_timer_stop(
- struct isci_timer *isci_timer);
-
+int isci_timer_list_construct(struct isci_host *ihost);
+void isci_timer_list_destroy(struct isci_host *ihost);
+struct isci_timer *isci_timer_create(struct isci_host *ihost, void *cb_param,
+ void (*timer_callback)(void *));
+void isci_del_timer(struct isci_host *ihost, struct isci_timer *itimer);
+void isci_timer_start(struct isci_timer *isci_timer, unsigned long timeout);
+void isci_timer_stop(struct isci_timer *isci_timer);
#endif /* !defined (_SCI_TIMER_H_) */
-