summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2018-04-04 09:54:05 -0400
committerCorey Minyard <cminyard@mvista.com>2018-04-18 11:22:50 -0400
commit6dc1181f9fbcf7ba0e62adfaea41666f00ee9d18 (patch)
treeebf7e35c4c6234b17335d78a583747002a5086a3
parentc81c5fc2128e3a596900859f10e294e30bc49b24 (diff)
ipmi: Clean up comments in include files.
Make the comments correct and consistent. Signed-off-by: Corey Minyard <cminyard@mvista.com>
-rw-r--r--include/linux/ipmi.h105
-rw-r--r--include/linux/ipmi_smi.h115
2 files changed, 134 insertions, 86 deletions
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 39a29fb3131b..3474f04cf9aa 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -23,8 +23,10 @@
23struct module; 23struct module;
24struct device; 24struct device;
25 25
26/* Opaque type for a IPMI message user. One of these is needed to 26/*
27 send and receive messages. */ 27 * Opaque type for a IPMI message user. One of these is needed to
28 * send and receive messages.
29 */
28typedef struct ipmi_user *ipmi_user_t; 30typedef struct ipmi_user *ipmi_user_t;
29 31
30/* 32/*
@@ -37,8 +39,10 @@ typedef struct ipmi_user *ipmi_user_t;
37struct ipmi_recv_msg { 39struct ipmi_recv_msg {
38 struct list_head link; 40 struct list_head link;
39 41
40 /* The type of message as defined in the "Receive Types" 42 /*
41 defines above. */ 43 * The type of message as defined in the "Receive Types"
44 * defines above.
45 */
42 int recv_type; 46 int recv_type;
43 47
44 ipmi_user_t user; 48 ipmi_user_t user;
@@ -46,19 +50,25 @@ struct ipmi_recv_msg {
46 long msgid; 50 long msgid;
47 struct kernel_ipmi_msg msg; 51 struct kernel_ipmi_msg msg;
48 52
49 /* The user_msg_data is the data supplied when a message was 53 /*
50 sent, if this is a response to a sent message. If this is 54 * The user_msg_data is the data supplied when a message was
51 not a response to a sent message, then user_msg_data will 55 * sent, if this is a response to a sent message. If this is
52 be NULL. If the user above is NULL, then this will be the 56 * not a response to a sent message, then user_msg_data will
53 intf. */ 57 * be NULL. If the user above is NULL, then this will be the
58 * intf.
59 */
54 void *user_msg_data; 60 void *user_msg_data;
55 61
56 /* Call this when done with the message. It will presumably free 62 /*
57 the message and do any other necessary cleanup. */ 63 * Call this when done with the message. It will presumably free
64 * the message and do any other necessary cleanup.
65 */
58 void (*done)(struct ipmi_recv_msg *msg); 66 void (*done)(struct ipmi_recv_msg *msg);
59 67
60 /* Place-holder for the data, don't make any assumptions about 68 /*
61 the size or existence of this, since it may change. */ 69 * Place-holder for the data, don't make any assumptions about
70 * the size or existence of this, since it may change.
71 */
62 unsigned char msg_data[IPMI_MAX_MSG_LENGTH]; 72 unsigned char msg_data[IPMI_MAX_MSG_LENGTH];
63}; 73};
64 74
@@ -66,16 +76,20 @@ struct ipmi_recv_msg {
66void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); 76void ipmi_free_recv_msg(struct ipmi_recv_msg *msg);
67 77
68struct ipmi_user_hndl { 78struct ipmi_user_hndl {
69 /* Routine type to call when a message needs to be routed to 79 /*
70 the upper layer. This will be called with some locks held, 80 * Routine type to call when a message needs to be routed to
71 the only IPMI routines that can be called are ipmi_request 81 * the upper layer. This will be called with some locks held,
72 and the alloc/free operations. The handler_data is the 82 * the only IPMI routines that can be called are ipmi_request
73 variable supplied when the receive handler was registered. */ 83 * and the alloc/free operations. The handler_data is the
84 * variable supplied when the receive handler was registered.
85 */
74 void (*ipmi_recv_hndl)(struct ipmi_recv_msg *msg, 86 void (*ipmi_recv_hndl)(struct ipmi_recv_msg *msg,
75 void *user_msg_data); 87 void *user_msg_data);
76 88
77 /* Called when the interface detects a watchdog pre-timeout. If 89 /*
78 this is NULL, it will be ignored for the user. */ 90 * Called when the interface detects a watchdog pre-timeout. If
91 * this is NULL, it will be ignored for the user.
92 */
79 void (*ipmi_watchdog_pretimeout)(void *handler_data); 93 void (*ipmi_watchdog_pretimeout)(void *handler_data);
80 94
81 /* 95 /*
@@ -91,12 +105,14 @@ int ipmi_create_user(unsigned int if_num,
91 void *handler_data, 105 void *handler_data,
92 ipmi_user_t *user); 106 ipmi_user_t *user);
93 107
94/* Destroy the given user of the IPMI layer. Note that after this 108/*
95 function returns, the system is guaranteed to not call any 109 * Destroy the given user of the IPMI layer. Note that after this
96 callbacks for the user. Thus as long as you destroy all the users 110 * function returns, the system is guaranteed to not call any
97 before you unload a module, you will be safe. And if you destroy 111 * callbacks for the user. Thus as long as you destroy all the users
98 the users before you destroy the callback structures, it should be 112 * before you unload a module, you will be safe. And if you destroy
99 safe, too. */ 113 * the users before you destroy the callback structures, it should be
114 * safe, too.
115 */
100int ipmi_destroy_user(ipmi_user_t user); 116int ipmi_destroy_user(ipmi_user_t user);
101 117
102/* Get the IPMI version of the BMC we are talking to. */ 118/* Get the IPMI version of the BMC we are talking to. */
@@ -104,12 +120,15 @@ int ipmi_get_version(ipmi_user_t user,
104 unsigned char *major, 120 unsigned char *major,
105 unsigned char *minor); 121 unsigned char *minor);
106 122
107/* Set and get the slave address and LUN that we will use for our 123/*
108 source messages. Note that this affects the interface, not just 124 * Set and get the slave address and LUN that we will use for our
109 this user, so it will affect all users of this interface. This is 125 * source messages. Note that this affects the interface, not just
110 so some initialization code can come in and do the OEM-specific 126 * this user, so it will affect all users of this interface. This is
111 things it takes to determine your address (if not the BMC) and set 127 * so some initialization code can come in and do the OEM-specific
112 it for everyone else. Note that each channel can have its own address. */ 128 * things it takes to determine your address (if not the BMC) and set
129 * it for everyone else. Note that each channel can have its own
130 * address.
131 */
113int ipmi_set_my_address(ipmi_user_t user, 132int ipmi_set_my_address(ipmi_user_t user,
114 unsigned int channel, 133 unsigned int channel,
115 unsigned char address); 134 unsigned char address);
@@ -235,14 +254,18 @@ int ipmi_set_gets_events(ipmi_user_t user, bool val);
235struct ipmi_smi_watcher { 254struct ipmi_smi_watcher {
236 struct list_head link; 255 struct list_head link;
237 256
238 /* You must set the owner to the current module, if you are in 257 /*
239 a module (generally just set it to "THIS_MODULE"). */ 258 * You must set the owner to the current module, if you are in
259 * a module (generally just set it to "THIS_MODULE").
260 */
240 struct module *owner; 261 struct module *owner;
241 262
242 /* These two are called with read locks held for the interface 263 /*
243 the watcher list. So you can add and remove users from the 264 * These two are called with read locks held for the interface
244 IPMI interface, send messages, etc., but you cannot add 265 * the watcher list. So you can add and remove users from the
245 or remove SMI watchers or SMI interfaces. */ 266 * IPMI interface, send messages, etc., but you cannot add
267 * or remove SMI watchers or SMI interfaces.
268 */
246 void (*new_smi)(int if_num, struct device *dev); 269 void (*new_smi)(int if_num, struct device *dev);
247 void (*smi_gone)(int if_num); 270 void (*smi_gone)(int if_num);
248}; 271};
@@ -250,8 +273,10 @@ struct ipmi_smi_watcher {
250int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher); 273int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher);
251int ipmi_smi_watcher_unregister(struct ipmi_smi_watcher *watcher); 274int ipmi_smi_watcher_unregister(struct ipmi_smi_watcher *watcher);
252 275
253/* The following are various helper functions for dealing with IPMI 276/*
254 addresses. */ 277 * The following are various helper functions for dealing with IPMI
278 * addresses.
279 */
255 280
256/* Return the maximum length of an IPMI address given it's type. */ 281/* Return the maximum length of an IPMI address given it's type. */
257unsigned int ipmi_addr_length(int addr_type); 282unsigned int ipmi_addr_length(int addr_type);
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index af457b5a689e..9e5c3079d232 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -22,8 +22,10 @@
22 22
23struct device; 23struct device;
24 24
25/* This files describes the interface for IPMI system management interface 25/*
26 drivers to bind into the IPMI message handler. */ 26 * This files describes the interface for IPMI system management interface
27 * drivers to bind into the IPMI message handler.
28 */
27 29
28/* Structure for the low-level drivers. */ 30/* Structure for the low-level drivers. */
29typedef struct ipmi_smi *ipmi_smi_t; 31typedef struct ipmi_smi *ipmi_smi_t;
@@ -61,10 +63,12 @@ struct ipmi_smi_msg {
61struct ipmi_smi_handlers { 63struct ipmi_smi_handlers {
62 struct module *owner; 64 struct module *owner;
63 65
64 /* The low-level interface cannot start sending messages to 66 /*
65 the upper layer until this function is called. This may 67 * The low-level interface cannot start sending messages to
66 not be NULL, the lower layer must take the interface from 68 * the upper layer until this function is called. This may
67 this call. */ 69 * not be NULL, the lower layer must take the interface from
70 * this call.
71 */
68 int (*start_processing)(void *send_info, 72 int (*start_processing)(void *send_info,
69 ipmi_smi_t new_intf); 73 ipmi_smi_t new_intf);
70 74
@@ -75,25 +79,31 @@ struct ipmi_smi_handlers {
75 */ 79 */
76 int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data); 80 int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data);
77 81
78 /* Called to enqueue an SMI message to be sent. This 82 /*
79 operation is not allowed to fail. If an error occurs, it 83 * Called to enqueue an SMI message to be sent. This
80 should report back the error in a received message. It may 84 * operation is not allowed to fail. If an error occurs, it
81 do this in the current call context, since no write locks 85 * should report back the error in a received message. It may
82 are held when this is run. Message are delivered one at 86 * do this in the current call context, since no write locks
83 a time by the message handler, a new message will not be 87 * are held when this is run. Message are delivered one at
84 delivered until the previous message is returned. */ 88 * a time by the message handler, a new message will not be
89 * delivered until the previous message is returned.
90 */
85 void (*sender)(void *send_info, 91 void (*sender)(void *send_info,
86 struct ipmi_smi_msg *msg); 92 struct ipmi_smi_msg *msg);
87 93
88 /* Called by the upper layer to request that we try to get 94 /*
89 events from the BMC we are attached to. */ 95 * Called by the upper layer to request that we try to get
96 * events from the BMC we are attached to.
97 */
90 void (*request_events)(void *send_info); 98 void (*request_events)(void *send_info);
91 99
92 /* Called by the upper layer when some user requires that the 100 /*
93 interface watch for events, received messages, watchdog 101 * Called by the upper layer when some user requires that the
94 pretimeouts, or not. Used by the SMI to know if it should 102 * interface watch for events, received messages, watchdog
95 watch for these. This may be NULL if the SMI does not 103 * pretimeouts, or not. Used by the SMI to know if it should
96 implement it. */ 104 * watch for these. This may be NULL if the SMI does not
105 * implement it.
106 */
97 void (*set_need_watch)(void *send_info, bool enable); 107 void (*set_need_watch)(void *send_info, bool enable);
98 108
99 /* 109 /*
@@ -101,28 +111,36 @@ struct ipmi_smi_handlers {
101 */ 111 */
102 void (*flush_messages)(void *send_info); 112 void (*flush_messages)(void *send_info);
103 113
104 /* Called when the interface should go into "run to 114 /*
105 completion" mode. If this call sets the value to true, the 115 * Called when the interface should go into "run to
106 interface should make sure that all messages are flushed 116 * completion" mode. If this call sets the value to true, the
107 out and that none are pending, and any new requests are run 117 * interface should make sure that all messages are flushed
108 to completion immediately. */ 118 * out and that none are pending, and any new requests are run
119 * to completion immediately.
120 */
109 void (*set_run_to_completion)(void *send_info, bool run_to_completion); 121 void (*set_run_to_completion)(void *send_info, bool run_to_completion);
110 122
111 /* Called to poll for work to do. This is so upper layers can 123 /*
112 poll for operations during things like crash dumps. */ 124 * Called to poll for work to do. This is so upper layers can
125 * poll for operations during things like crash dumps.
126 */
113 void (*poll)(void *send_info); 127 void (*poll)(void *send_info);
114 128
115 /* Enable/disable firmware maintenance mode. Note that this 129 /*
116 is *not* the modes defined, this is simply an on/off 130 * Enable/disable firmware maintenance mode. Note that this
117 setting. The message handler does the mode handling. Note 131 * is *not* the modes defined, this is simply an on/off
118 that this is called from interrupt context, so it cannot 132 * setting. The message handler does the mode handling. Note
119 block. */ 133 * that this is called from interrupt context, so it cannot
134 * block.
135 */
120 void (*set_maintenance_mode)(void *send_info, bool enable); 136 void (*set_maintenance_mode)(void *send_info, bool enable);
121 137
122 /* Tell the handler that we are using it/not using it. The 138 /*
123 message handler get the modules that this handler belongs 139 * Tell the handler that we are using it/not using it. The
124 to; this function lets the SMI claim any modules that it 140 * message handler get the modules that this handler belongs
125 uses. These may be NULL if this is not required. */ 141 * to; this function lets the SMI claim any modules that it
142 * uses. These may be NULL if this is not required.
143 */
126 int (*inc_usecount)(void *send_info); 144 int (*inc_usecount)(void *send_info);
127 void (*dec_usecount)(void *send_info); 145 void (*dec_usecount)(void *send_info);
128}; 146};
@@ -143,7 +161,8 @@ struct ipmi_device_id {
143#define ipmi_version_major(v) ((v)->ipmi_version & 0xf) 161#define ipmi_version_major(v) ((v)->ipmi_version & 0xf)
144#define ipmi_version_minor(v) ((v)->ipmi_version >> 4) 162#define ipmi_version_minor(v) ((v)->ipmi_version >> 4)
145 163
146/* Take a pointer to an IPMI response and extract device id information from 164/*
165 * Take a pointer to an IPMI response and extract device id information from
147 * it. @netfn is in the IPMI_NETFN_ format, so may need to be shifted from 166 * it. @netfn is in the IPMI_NETFN_ format, so may need to be shifted from
148 * a SI response. 167 * a SI response.
149 */ 168 */
@@ -187,12 +206,14 @@ static inline int ipmi_demangle_device_id(uint8_t netfn, uint8_t cmd,
187 return 0; 206 return 0;
188} 207}
189 208
190/* Add a low-level interface to the IPMI driver. Note that if the 209/*
191 interface doesn't know its slave address, it should pass in zero. 210 * Add a low-level interface to the IPMI driver. Note that if the
192 The low-level interface should not deliver any messages to the 211 * interface doesn't know its slave address, it should pass in zero.
193 upper layer until the start_processing() function in the handlers 212 * The low-level interface should not deliver any messages to the
194 is called, and the lower layer must get the interface from that 213 * upper layer until the start_processing() function in the handlers
195 call. */ 214 * is called, and the lower layer must get the interface from that
215 * call.
216 */
196int ipmi_register_smi(const struct ipmi_smi_handlers *handlers, 217int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
197 void *send_info, 218 void *send_info,
198 struct device *dev, 219 struct device *dev,
@@ -223,9 +244,11 @@ static inline void ipmi_free_smi_msg(struct ipmi_smi_msg *msg)
223} 244}
224 245
225#ifdef CONFIG_IPMI_PROC_INTERFACE 246#ifdef CONFIG_IPMI_PROC_INTERFACE
226/* Allow the lower layer to add things to the proc filesystem 247/*
227 directory for this interface. Note that the entry will 248 * Allow the lower layer to add things to the proc filesystem
228 automatically be dstroyed when the interface is destroyed. */ 249 * directory for this interface. Note that the entry will
250 * automatically be dstroyed when the interface is destroyed.
251 */
229int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, 252int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
230 const struct file_operations *proc_ops, 253 const struct file_operations *proc_ops,
231 void *data); 254 void *data);