1 /*
2  * ipmi_mc.h
3  *
4  * MontaVista IPMI interface for management controllers
5  *
6  * Author: MontaVista Software, Inc.
7  *         Corey Minyard <minyard@mvista.com>
8  *         source@mvista.com
9  *
10  * Copyright 2002,2003,2004 MontaVista Software Inc.
11  *
12  *  This program is free software; you can redistribute it and/or
13  *  modify it under the terms of the GNU Lesser General Public License
14  *  as published by the Free Software Foundation; either version 2 of
15  *  the License, or (at your option) any later version.
16  *
17  *
18  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  *  You should have received a copy of the GNU Lesser General Public
30  *  License along with this program; if not, write to the Free
31  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32  */
33 
34 #ifndef OPENIPMI_MC_H
35 #define OPENIPMI_MC_H
36 #include <OpenIPMI/ipmi_types.h>
37 #include <OpenIPMI/ipmi_sdr.h>
38 #include <OpenIPMI/ipmi_bits.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /* MCs are mostly internal items in OpenIPMI, but they are here because
45    they are sometimes useful.  It is at least theoretically possible to
46    put a non-IPMI system under OpenIPMI, and if you do the MCs won't
47    be very useful.  You generally shouldn't need them anyway. */
48 
49 ipmi_mcid_t ipmi_mc_convert_to_id(ipmi_mc_t *mc);
50 typedef void (*ipmi_mc_ptr_cb)(ipmi_mc_t *mc, void *cb_data);
51 int ipmi_mc_pointer_cb(ipmi_mcid_t    id,
52 		       ipmi_mc_ptr_cb handler,
53 		       void           *cb_data);
54 int ipmi_mc_pointer_noseq_cb(ipmi_mcid_t    id,
55 			     ipmi_mc_ptr_cb handler,
56 			     void           *cb_data);
57 int ipmi_cmp_mc_id(ipmi_mcid_t id1, ipmi_mcid_t id2);
58 int ipmi_cmp_mc_id_noseq(ipmi_mcid_t id1, ipmi_mcid_t id2);
59 void ipmi_mc_id_set_invalid(ipmi_mcid_t *id);
60 /* Is it the invalid MCID? */
61 int ipmi_mc_id_is_invalid(ipmi_mcid_t *id);
62 
63 
64 /* Generic callback type for MCs */
65 typedef void (*ipmi_mc_done_cb)(ipmi_mc_t *mc, int err, void *cb_data);
66 typedef void (*ipmi_mc_data_done_cb)(ipmi_mc_t *mc, int err, int value,
67 				     void *cb_data);
68 
69 /* Get the name of an MC. */
70 #define IPMI_MC_NAME_LEN (IPMI_DOMAIN_NAME_LEN + 32)
71 int ipmi_mc_get_name(ipmi_mc_t *mc, char *name, int length);
72 
73 /* Return the domain for the given MC. */
74 ipmi_domain_t *ipmi_mc_get_domain(ipmi_mc_t *mc);
75 
76 /* Basic information about a MC.  */
77 int ipmi_mc_provides_device_sdrs(ipmi_mc_t *mc);
78 int ipmi_mc_device_available(ipmi_mc_t *mc);
79 int ipmi_mc_chassis_support(ipmi_mc_t *mc);
80 int ipmi_mc_bridge_support(ipmi_mc_t *mc);
81 int ipmi_mc_ipmb_event_generator_support(ipmi_mc_t *mc);
82 int ipmi_mc_ipmb_event_receiver_support(ipmi_mc_t *mc);
83 int ipmi_mc_fru_inventory_support(ipmi_mc_t *mc);
84 int ipmi_mc_sel_device_support(ipmi_mc_t *mc);
85 int ipmi_mc_sdr_repository_support(ipmi_mc_t *mc);
86 int ipmi_mc_sensor_device_support(ipmi_mc_t *mc);
87 int ipmi_mc_device_id(ipmi_mc_t *mc);
88 int ipmi_mc_device_revision(ipmi_mc_t *mc);
89 int ipmi_mc_major_fw_revision(ipmi_mc_t *mc);
90 int ipmi_mc_minor_fw_revision(ipmi_mc_t *mc);
91 int ipmi_mc_major_version(ipmi_mc_t *mc);
92 int ipmi_mc_minor_version(ipmi_mc_t *mc);
93 int ipmi_mc_manufacturer_id(ipmi_mc_t *mc);
94 int ipmi_mc_product_id(ipmi_mc_t *mc);
95 void ipmi_mc_aux_fw_revision(ipmi_mc_t *mc, unsigned char val[]);
96 
97 /* Get the GUID (if it is available).  Returns ENOSYS if the GUID is
98    not available.  guid must point to 16 bytes of data. */
99 int ipmi_mc_get_guid(ipmi_mc_t *mc, unsigned char *guid);
100 
101 /* Check to see if the MC is operational in the system.  If this is
102    false, then the MC was referred to by an SDR, but it doesn't really
103    exist. */
104 int ipmi_mc_is_active(ipmi_mc_t *mc);
105 
106 /* Used to monitor when the MC goes active or inactive. */
107 typedef void (*ipmi_mc_active_cb)(ipmi_mc_t *mc,
108 				  int       active,
109 				  void      *cb_data);
110 int ipmi_mc_add_active_handler(ipmi_mc_t         *mc,
111 			       ipmi_mc_active_cb handler,
112 			       void              *cb_data);
113 int ipmi_mc_remove_active_handler(ipmi_mc_t         *mc,
114 				  ipmi_mc_active_cb handler,
115 				  void              *cb_data);
116 typedef void (*ipmi_mc_active_cl_cb)(ipmi_mc_active_cb handler,
117 				     void              *handler_data,
118 				     void              *cb_data);
119 int ipmi_mc_add_active_handler_cl(ipmi_mc_t            *mc,
120 				  ipmi_mc_active_cl_cb handler,
121 				  void                 *event_data);
122 int ipmi_mc_remove_active_handler_cl(ipmi_mc_t            *mc,
123 				     ipmi_mc_active_cl_cb handler,
124 				     void                 *event_data);
125 
126 /* Used to tell when an MC goes "fully up" meaning that all its SDRs
127    have been read, etc. */
128 int ipmi_mc_add_fully_up_handler(ipmi_mc_t      *mc,
129 				 ipmi_mc_ptr_cb handler,
130 				 void           *cb_data);
131 int ipmi_mc_remove_fully_up_handler(ipmi_mc_t      *mc,
132 				    ipmi_mc_ptr_cb handler,
133 				    void           *cb_data);
134 typedef void (*ipmi_mc_fully_up_cl_cb)(ipmi_mc_ptr_cb handler,
135 				       void           *handler_data,
136 				       void           *cb_data);
137 int ipmi_mc_add_fully_up_handler_cl(ipmi_mc_t              *mc,
138 				    ipmi_mc_fully_up_cl_cb handler,
139 				    void                   *event_data);
140 int ipmi_mc_remove_fully_up_handler_cl(ipmi_mc_t              *mc,
141 				       ipmi_mc_fully_up_cl_cb handler,
142 				       void                  *event_data);
143 
144 /* Send the command in "msg" and register a handler to handle the
145    response.  This will return without blocking; when the response
146    comes back the handler will be called.  The handler may be NULL;
147    then the response is ignored.  Note that if non-NULL the response
148    handler will always be called; if no response is received in time
149    the code will return a timeout response. rsp_data is passed to the
150    response handler, it may contain anything the user likes.  Note
151    that if the mc goes away between the time the command is sent and
152    the response comes back, this callback WILL be called, but the MC
153    value will be NULL.  You must handle that.
154 
155    The sideeff version is for commands that have side effects.  This
156    is primarily reserve commands, where if a link is slow a retransmit
157    can cause problems. */
158 typedef void (*ipmi_mc_response_handler_t)(ipmi_mc_t  *src,
159 					   ipmi_msg_t *msg,
160 					   void       *rsp_data);
161 int ipmi_mc_send_command(ipmi_mc_t                  *mc,
162 			 unsigned int               lun,
163 			 const ipmi_msg_t           *cmd,
164 			 ipmi_mc_response_handler_t rsp_handler,
165 			 void                       *rsp_data);
166 int ipmi_mc_send_command_sideeff(ipmi_mc_t                  *mc,
167 				 unsigned int               lun,
168 				 const ipmi_msg_t           *cmd,
169 				 ipmi_mc_response_handler_t rsp_handler,
170 				 void                       *rsp_data);
171 
172 /* Reset the MC, either a cold or warm reset depending on the type.
173    Note that the effects of a reset are not defined by IPMI, so this
174    might do wierd things.  Some systems do not support resetting the
175    MC.  This is not a standard control because there is no entity to
176    hang if from and you don't want people messing with it unless they
177    really know what they are doing. */
178 #define IPMI_MC_RESET_COLD 1
179 #define IPMI_MC_RESET_WARM 2
180 int ipmi_mc_reset(ipmi_mc_t       *mc,
181 		  int             reset_type,
182 		  ipmi_mc_done_cb done,
183 		  void            *cb_data);
184 
185 /* Get and set the setting to enable events for the entire MC.  The
186    value returned by the get function is a boolean telling whether
187    events are enabled.  The "val" passed in to the set function is a
188    boolean telling whether to turn events on (true) or off (false). */
189 int ipmi_mc_get_events_enable(ipmi_mc_t *mc);
190 int ipmi_mc_set_events_enable(ipmi_mc_t       *mc,
191 			      int             val,
192 			      ipmi_mc_done_cb done,
193 			      void            *cb_data);
194 
195 /*
196  * Get and set the event log enable flag on the MC.  If this is
197  * enabled (true), events will go into the event log on the MC.  If
198  * this is disabled, events will be ignored by the MC (except for ones
199  * added directly with an add_event call).
200  *
201  * NOTE: This is a somewhat dangerous call to set, since other flags
202  * are also set in the same message and there is no way to set them
203  * individually.  The set function does a read-modify-write, but there
204  * is a race condition.  If other things are also setting the same
205  * flags (like a device driver), it is recommended that you *NOT* use
206  * this function.  In fact, in general, it is recommended that you not
207  * use this function except perhaps to ensure that events are on.
208  * They should be on by default, anyway.
209  */
210 int ipmi_mc_get_event_log_enable(ipmi_mc_t            *mc,
211 				 ipmi_mc_data_done_cb done,
212 				 void                 *cb_data);
213 int ipmi_mc_set_event_log_enable(ipmi_mc_t       *mc,
214 				 int             val,
215 				 ipmi_mc_done_cb done,
216 				 void            *cb_data);
217 
218 /* Reread all the sensors for a given mc.  This will request the
219    device SDRs for that mc (And only for that MC) and change the
220    sensors as necessary. */
221 int ipmi_mc_reread_sensors(ipmi_mc_t       *mc,
222 			   ipmi_mc_done_cb done,
223 			   void            *done_data);
224 
225 /*
226  * SEL support for the MC
227  */
228 void ipmi_mc_set_sel_rescan_time(ipmi_mc_t *mc, unsigned int seconds);
229 unsigned int ipmi_mc_get_sel_rescan_time(ipmi_mc_t *mc);
230 
231 /* Reread the sel.  When the hander is called, all the events in the
232    SEL have been fetched into the local copy of the SEL (with the
233    obvious caveat that this is a distributed system and other things
234    may have come in after the read has finised). */
235 int ipmi_mc_reread_sel(ipmi_mc_t       *mc,
236 		       ipmi_mc_done_cb handler,
237 		       void            *cb_data);
238 
239 /* Fetch the current time from the SEL. */
240 typedef void (*sel_get_time_cb)(ipmi_mc_t     *mc,
241 				int           err,
242 				unsigned long time,
243 				void          *cb_data);
244 int ipmi_mc_get_current_sel_time(ipmi_mc_t       *mc,
245 				 sel_get_time_cb handler,
246 				 void            *cb_data);
247 
248 /* Set the time for the SEL.  Note that this function is rather
249    dangerous to do, especially if you don't set it to the current
250    time, as it can cause old events to be interpreted as new
251    events on this and other systems. */
252 int ipmi_mc_set_current_sel_time(ipmi_mc_t            *mc,
253 				 const struct timeval *time,
254 				 ipmi_mc_done_cb      handler,
255 				 void                 *cb_data);
256 
257 
258 /* Add an event to the real SEL.  This does not directly put it into
259    the internal copy of the SEL. */
260 typedef void (*ipmi_mc_add_event_done_cb)(ipmi_mc_t    *mc,
261 					  unsigned int record_id,
262 					  int          err,
263 					  void         *cb_data);
264 int ipmi_mc_add_event_to_sel(ipmi_mc_t                 *mc,
265 			     ipmi_event_t              *event,
266 			     ipmi_mc_add_event_done_cb handler,
267 			     void                      *cb_data);
268 
269 /* Allocate an event with the given data.  This is required so you can
270    add it to the SEL. */
271 ipmi_event_t *ipmi_event_alloc(ipmi_mcid_t   mcid,
272 			       unsigned int  record_id,
273 			       unsigned int  type,
274 			       ipmi_time_t   timestamp,
275 			       unsigned char *data,
276 			       unsigned int  data_len);
277 
278 typedef void (ipmi_mc_del_event_done_cb)(ipmi_mc_t *mc, int err, void *cb_data);
279 int ipmi_mc_del_event(ipmi_mc_t                 *mc,
280 		      ipmi_event_t              *event,
281 		      ipmi_mc_del_event_done_cb handler,
282 		      void                      *cb_data);
283 
284 /* Clear out all the events in the SEL if and only if the last_event
285    passed in is the last event in the SEL.  Note that use of this is
286    *HIGHLY* discouraged.  This is only here for HPI support.  In
287    general, you should delete individual events and OpenIPMI will do
288    the right thing (do a clear if they are all gone, do individual
289    deletes if possible otherwise, etc.).  If you pass in NULL for
290    last_event, it forces a clear of the SEL without checking anything.
291    Very dangerous, events can be lost. */
292 int ipmi_mc_sel_clear(ipmi_mc_t                 *mc,
293 		      ipmi_event_t              *last_event,
294 		      ipmi_mc_del_event_done_cb handler,
295 		      void                      *cb_data);
296 
297 
298 ipmi_event_t *ipmi_mc_first_event(ipmi_mc_t *mc);
299 ipmi_event_t *ipmi_mc_last_event(ipmi_mc_t *mc);
300 ipmi_event_t *ipmi_mc_next_event(ipmi_mc_t *mc, const ipmi_event_t *event);
301 ipmi_event_t *ipmi_mc_prev_event(ipmi_mc_t *mc, const ipmi_event_t *event);
302 ipmi_event_t *ipmi_mc_event_by_recid(ipmi_mc_t *mc,
303 				     unsigned int record_id);
304 int ipmi_mc_sel_count(ipmi_mc_t *mc);
305 int ipmi_mc_sel_entries_used(ipmi_mc_t *mc);
306 int ipmi_mc_sel_get_major_version(ipmi_mc_t *mc);
307 int ipmi_mc_sel_get_minor_version(ipmi_mc_t *mc);
308 int ipmi_mc_sel_get_num_entries(ipmi_mc_t *mc);
309 int ipmi_mc_sel_get_free_bytes(ipmi_mc_t *mc);
310 int ipmi_mc_sel_get_overflow(ipmi_mc_t *mc);
311 int ipmi_mc_sel_get_supports_delete_sel(ipmi_mc_t *mc);
312 int ipmi_mc_sel_get_supports_partial_add_sel(ipmi_mc_t *mc);
313 int ipmi_mc_sel_get_supports_reserve_sel(ipmi_mc_t *mc);
314 int ipmi_mc_sel_get_supports_get_sel_allocation(ipmi_mc_t *mc);
315 int ipmi_mc_sel_get_last_addition_timestamp(ipmi_mc_t *mc);
316 
317 
318 /* Get the MC's full IPMI address. */
319 void ipmi_mc_get_ipmi_address(ipmi_mc_t    *mc,
320 			      ipmi_addr_t  *addr,
321 			      unsigned int *addr_len);
322 
323 /* Get the IPMI slave address of the given MC. */
324 unsigned ipmi_mc_get_address(ipmi_mc_t *mc);
325 
326 /* Get the channel for the given MC. */
327 unsigned ipmi_mc_get_channel(ipmi_mc_t *mc);
328 
329 
330 /***********************************************************************
331  *
332  * Channel handling for MCs.
333  *
334  ***********************************************************************/
335 
336 /*
337  * Fetch channel information.  Note that you cannot keep the channel
338  * info data structure passed to you, you can just use it to extract
339  * the data you want.
340  */
341 typedef struct ipmi_channel_info_s ipmi_channel_info_t;
342 typedef void (*ipmi_channel_info_cb)(ipmi_mc_t           *mc,
343 				     int                 err,
344 				     ipmi_channel_info_t *info,
345 				     void                *cb_data);
346 int ipmi_mc_channel_get_info(ipmi_mc_t            *mc,
347 			     unsigned int         channel,
348 			     ipmi_channel_info_cb handler,
349 			     void                 *cb_data);
350 
351 /*
352  * Allow the user to keep their own copy of the info data.  Note that
353  * you should *NOT* free the info data you get from the get_info.
354  */
355 ipmi_channel_info_t *ipmi_channel_info_copy(ipmi_channel_info_t *info);
356 void ipmi_channel_info_free(ipmi_channel_info_t *info);
357 
358 /*
359  * Extract various data from the channel.
360  */
361 int ipmi_channel_info_get_channel(ipmi_channel_info_t *info,
362 				  unsigned int        *channel);
363 
364 /* IANA-assigned number for IPMI, used for some defaults */
365 #define IPMI_ENTERPRISE_NUMBER		0x001bf2
366 
367 #define IPMI_CHANNEL_MEDIUM_IPMB	1
368 #define IPMI_CHANNEL_MEDIUM_ICMB_V10	2
369 #define IPMI_CHANNEL_MEDIUM_ICMB_V09	3
370 #define IPMI_CHANNEL_MEDIUM_8023_LAN	4
371 #define IPMI_CHANNEL_MEDIUM_RS232	5
372 #define IPMI_CHANNEL_MEDIUM_OTHER_LAN	6
373 #define IPMI_CHANNEL_MEDIUM_PCI_SMBUS	7
374 #define IPMI_CHANNEL_MEDIUM_SMBUS_v1	8
375 #define IPMI_CHANNEL_MEDIUM_SMBUS_v2	9
376 #define IPMI_CHANNEL_MEDIUM_USB_v1	10
377 #define IPMI_CHANNEL_MEDIUM_USB_v2	11
378 #define IPMI_CHANNEL_MEDIUM_SYS_INTF	12
379 const char *ipmi_channel_medium_string(int val);
380 int ipmi_channel_info_get_medium(ipmi_channel_info_t *info,
381 				 unsigned int        *medium);
382 #define IPMI_CHANNEL_PROTOCOL_IPMB	1
383 #define IPMI_CHANNEL_PROTOCOL_ICMB	2
384 #define IPMI_CHANNEL_PROTOCOL_SMBus	4
385 #define IPMI_CHANNEL_PROTOCOL_KCS	5
386 #define IPMI_CHANNEL_PROTOCOL_SMIC	6
387 #define IPMI_CHANNEL_PROTOCOL_BT_v10	7
388 #define IPMI_CHANNEL_PROTOCOL_BT_v15	8
389 #define IPMI_CHANNEL_PROTOCOL_TMODE	9
390 const char *ipmi_channel_protocol_string(int val);
391 int ipmi_channel_info_get_protocol_type(ipmi_channel_info_t *info,
392 					unsigned int        *prot_type);
393 
394 #define IPMI_CHANNEL_SESSION_LESS	0
395 #define IPMI_CHANNEL_SINGLE_SESSION	1
396 #define IPMI_CHANNEL_MULTI_SESSION	2
397 #define IPMI_CHANNEL_SESSION_BASED	3
398 const char *ipmi_channel_session_support_string(int val);
399 int ipmi_channel_info_get_session_support(ipmi_channel_info_t *info,
400 					  unsigned int        *sup);
401 /* Data is 3 bytes long */
402 int ipmi_channel_info_get_vendor_id(ipmi_channel_info_t *info,
403 				    unsigned char       *data);
404 /* Data is 2 bytes long */
405 int ipmi_channel_info_get_aux_info(ipmi_channel_info_t *info,
406 				   unsigned char       *data);
407 
408 /*
409  * Get and set the channel access information.  You should generally
410  * get the items you want, modify them, then write them back out.
411  */
412 typedef struct ipmi_channel_access_s ipmi_channel_access_t;
413 typedef void (*ipmi_channel_access_cb)(ipmi_mc_t             *mc,
414 				       int                   err,
415 				       ipmi_channel_access_t *info,
416 				       void                  *cb_data);
417 int ipmi_mc_channel_get_access(ipmi_mc_t              *mc,
418 			       unsigned int           channel,
419 			       enum ipmi_set_dest_e   dest,
420 			       ipmi_channel_access_cb handler,
421 			       void                   *cb_data);
422 int ipmi_mc_channel_set_access(ipmi_mc_t             *mc,
423 			       unsigned int           channel,
424 			       enum ipmi_set_dest_e  dest,
425 			       ipmi_channel_access_t *access,
426 			       ipmi_mc_done_cb       handler,
427 			       void                  *cb_data);
428 
429 /*
430  * Allow the user to keep their own copy of the info data.  Note that
431  * you should *NOT* free the info data you get from the get_access.
432  */
433 ipmi_channel_access_t *ipmi_channel_access_copy(ipmi_channel_access_t *access);
434 void ipmi_channel_access_free(ipmi_channel_access_t *access);
435 
436 /*
437  * Get and set various fields in the channel.
438  */
439 int ipmi_channel_access_get_channel(ipmi_channel_access_t *access,
440 				    unsigned int          *channel);
441 int ipmi_channel_access_get_alerting_enabled(ipmi_channel_access_t *access,
442 					     unsigned int          *enab);
443 int ipmi_channel_access_set_alerting_enabled(ipmi_channel_access_t *access,
444 					     unsigned int          enab);
445 int ipmi_channel_access_get_per_msg_auth(ipmi_channel_access_t *access,
446 					 unsigned int          *msg_auth);
447 int ipmi_channel_access_set_per_msg_auth(ipmi_channel_access_t *access,
448 					 unsigned int          msg_auth);
449 int ipmi_channel_access_get_user_auth(ipmi_channel_access_t *access,
450 				      unsigned int          *user_auth);
451 int ipmi_channel_access_set_user_auth(ipmi_channel_access_t *access,
452 				      unsigned int          user_auth);
453 #define IPMI_CHANNEL_ACCESS_MODE_DISABLED	0
454 #define IPMI_CHANNEL_ACCESS_MODE_PRE_BOOT	1
455 #define IPMI_CHANNEL_ACCESS_MODE_ALWAYS		2
456 #define IPMI_CHANNEL_ACCESS_MODE_SHARED		3
457 const char *ipmi_channel_access_mode_string(int val);
458 int ipmi_channel_access_get_access_mode(ipmi_channel_access_t *access,
459 					unsigned int          *access_mode);
460 int ipmi_channel_access_set_access_mode(ipmi_channel_access_t *access,
461 					unsigned int          access_mode);
462 /* See IPMI_PRIVILEGE_xxx for the values. */
463 int ipmi_channel_access_get_priv_limit(ipmi_channel_access_t *access,
464 				       unsigned int          *priv_limit);
465 int ipmi_channel_access_set_priv_limit(ipmi_channel_access_t *access,
466 				       unsigned int          priv_limit);
467 /* Normally setting will only set the values you have changed.  This
468    forces all the values to be set. */
469 int ipmi_channel_access_setall(ipmi_channel_access_t *access);
470 
471 /***********************************************************************
472  *
473  * Misc stuff...
474  *
475  **********************************************************************/
476 
477 /* Get the MC that the message is sent to for reading and controlling
478    the sensor.  The SDR for the sensor may not have come from here.
479    Note that this is not refcounted, it is held in existance by the
480    sensor's refcount.  So don't keep this after the sensor pointer
481    ceases to exist. */
482 ipmi_mc_t *ipmi_sensor_get_mc(ipmi_sensor_t *sensor);
483 
484 
485 /***********************************************************************
486  *
487  * Crufty backwards-compatible interfaces.  Don't use these as they
488  * are deprecated.
489  *
490  **********************************************************************/
491 
492 /* A monitor to tell when the SDRs and SELs for an MC are read for the
493    first time and are finished being processed.  Setting the handler
494    to NULL disables it.  Note this only works for the first time, it
495    will not be called on subsequent SDR and SEL reads and checks. */
496 int ipmi_mc_set_sdrs_first_read_handler(ipmi_mc_t      *mc,
497 					ipmi_mc_ptr_cb handler,
498 					void           *cb_data);
499 int ipmi_mc_set_sels_first_read_handler(ipmi_mc_t      *mc,
500 					ipmi_mc_ptr_cb handler,
501 					void           *cb_data);
502 
503 #ifdef __cplusplus
504 }
505 #endif
506 
507 #endif /* OPENIPMI_MC_H */
508