summaryrefslogtreecommitdiff
path: root/include/linux/ipmi_smi.h
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2018-10-23 11:29:02 -0500
committerCorey Minyard <cminyard@mvista.com>2019-02-09 19:48:42 -0600
commitc65ea996595005be470fbfa16711deba414fd33b (patch)
tree55b50d2d008afe4411e7085bf48f1f7e9e032f11 /include/linux/ipmi_smi.h
parenta1466ec5b671651b848df17fc9233ecbb7d35f9f (diff)
ipmi: Fix how the lower layers are told to watch for messages
The IPMI driver has a mechanism to tell the lower layers it needs to watch for messages, commands, and watchdogs (so it doesn't needlessly poll). However, it needed some extensions, it needed a way to tell what is being waited for so it could set the timeout appropriately. The update to the lower layer was also being done once a second at best because it was done in the main timeout handler. However, if a command is sent and a response message is coming back, it needed to be started immediately. So modify the code to update immediately if it needs to be enabled. Disable is still lazy. Signed-off-by: Corey Minyard <cminyard@mvista.com> Tested-by: Kamlakant Patel <kamlakant.patel@cavium.com>
Diffstat (limited to 'include/linux/ipmi_smi.h')
-rw-r--r--include/linux/ipmi_smi.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 8c4e2ab696c3..da6abb06a5dc 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -31,6 +31,17 @@ struct device;
struct ipmi_smi;
/*
+ * Flags for set_check_watch() below. Tells if the SMI should be
+ * waiting for watchdog timeouts, commands and/or messages. There is
+ * also an internal flag for the message handler, SMIs should ignore
+ * it.
+ */
+#define IPMI_WATCH_MASK_INTERNAL (1 << 0)
+#define IPMI_WATCH_MASK_CHECK_MESSAGES (1 << 1)
+#define IPMI_WATCH_MASK_CHECK_WATCHDOG (1 << 2)
+#define IPMI_WATCH_MASK_CHECK_COMMANDS (1 << 3)
+
+/*
* Messages to/from the lower layer. The smi interface will take one
* of these to send. After the send has occurred and a response has
* been received, it will report this same data structure back up to
@@ -55,8 +66,16 @@ struct ipmi_smi_msg {
int rsp_size;
unsigned char rsp[IPMI_MAX_MSG_LENGTH];
- /* Will be called when the system is done with the message
- (presumably to free it). */
+ /*
+ * There should be a response message coming back in the BMC
+ * message queue.
+ */
+ bool needs_response;
+
+ /*
+ * Will be called when the system is done with the message
+ * (presumably to free it).
+ */
void (*done)(struct ipmi_smi_msg *msg);
};
@@ -105,12 +124,15 @@ struct ipmi_smi_handlers {
/*
* Called by the upper layer when some user requires that the
- * interface watch for events, received messages, watchdog
- * pretimeouts, or not. Used by the SMI to know if it should
- * watch for these. This may be NULL if the SMI does not
- * implement it.
+ * interface watch for received messages and watchdog
+ * pretimeouts (basically do a "Get Flags", or not. Used by
+ * the SMI to know if it should watch for these. This may be
+ * NULL if the SMI does not implement it. watch_mask is from
+ * IPMI_WATCH_MASK_xxx above. The interface should run slower
+ * timeouts for just watchdog checking or faster timeouts when
+ * waiting for the message queue.
*/
- void (*set_need_watch)(void *send_info, bool enable);
+ void (*set_need_watch)(void *send_info, unsigned int watch_mask);
/*
* Called when flushing all pending messages.