ipmi: Add shutdown functions for users and interfaces
authorCorey Minyard <cminyard@mvista.com>
Thu, 5 Apr 2018 21:44:12 +0000 (16:44 -0500)
committerCorey Minyard <cminyard@mvista.com>
Wed, 18 Apr 2018 15:22:54 +0000 (10:22 -0500)
Since things that IPMI uses can be hot-swapped, the users and
interfaces really need to be able to handle this.

Add the functions so the users and interfaces can implement
them, the actual function will be added after everything is
ready.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
include/linux/ipmi.h
include/linux/ipmi_smi.h

index 3474f04..d89bea1 100644 (file)
@@ -97,6 +97,14 @@ struct ipmi_user_hndl {
         * been set up to handle run to completion.
         */
        void (*ipmi_panic_handler)(void *handler_data);
+
+       /*
+        * Called when the interface has been removed.  After this returns
+        * the user handle will be invalid.  The interface may or may
+        * not be usable when this is called, but it will return errors
+        * if it is not usable.
+        */
+       void (*shutdown)(void *handler_data);
 };
 
 /* Create a new user of the IPMI layer on the given interface number. */
index 9e5c307..bdcda47 100644 (file)
@@ -72,6 +72,12 @@ struct ipmi_smi_handlers {
        int (*start_processing)(void       *send_info,
                                ipmi_smi_t new_intf);
 
+       /*
+        * When called, the low-level interface should disable all
+        * processing, it should be complete shut down when it returns.
+        */
+       void (*shutdown)(void *send_info);
+
        /*
         * Get the detailed private info of the low level interface and store
         * it into the structure of ipmi_smi_data. For example: the