summaryrefslogtreecommitdiffstats
path: root/include/linux/ipmi.h
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 /include/linux/ipmi.h
parentc81c5fc2128e3a596900859f10e294e30bc49b24 (diff)
ipmi: Clean up comments in include files.
Make the comments correct and consistent. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'include/linux/ipmi.h')
-rw-r--r--include/linux/ipmi.h105
1 files changed, 65 insertions, 40 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);