xref: /dflybsd-src/sys/dev/misc/dimm/dimm.h (revision e30371b49539109267c23a480b6c765f029200db)
1881f7bffSSepherosa Ziehau /*
2881f7bffSSepherosa Ziehau  * Copyright (c) 2015 The DragonFly Project.  All rights reserved.
3881f7bffSSepherosa Ziehau  *
4881f7bffSSepherosa Ziehau  * This code is derived from software contributed to The DragonFly Project
5881f7bffSSepherosa Ziehau  * by Sepherosa Ziehau <sepherosa@gmail.com>
6881f7bffSSepherosa Ziehau  *
7881f7bffSSepherosa Ziehau  * Redistribution and use in source and binary forms, with or without
8881f7bffSSepherosa Ziehau  * modification, are permitted provided that the following conditions
9881f7bffSSepherosa Ziehau  * are met:
10881f7bffSSepherosa Ziehau  *
11881f7bffSSepherosa Ziehau  * 1. Redistributions of source code must retain the above copyright
12881f7bffSSepherosa Ziehau  *    notice, this list of conditions and the following disclaimer.
13881f7bffSSepherosa Ziehau  * 2. Redistributions in binary form must reproduce the above copyright
14881f7bffSSepherosa Ziehau  *    notice, this list of conditions and the following disclaimer in
15881f7bffSSepherosa Ziehau  *    the documentation and/or other materials provided with the
16881f7bffSSepherosa Ziehau  *    distribution.
17881f7bffSSepherosa Ziehau  * 3. Neither the name of The DragonFly Project nor the names of its
18881f7bffSSepherosa Ziehau  *    contributors may be used to endorse or promote products derived
19881f7bffSSepherosa Ziehau  *    from this software without specific, prior written permission.
20881f7bffSSepherosa Ziehau  *
21881f7bffSSepherosa Ziehau  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22881f7bffSSepherosa Ziehau  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23881f7bffSSepherosa Ziehau  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24881f7bffSSepherosa Ziehau  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25881f7bffSSepherosa Ziehau  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26881f7bffSSepherosa Ziehau  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27881f7bffSSepherosa Ziehau  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28881f7bffSSepherosa Ziehau  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29881f7bffSSepherosa Ziehau  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30881f7bffSSepherosa Ziehau  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31881f7bffSSepherosa Ziehau  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32881f7bffSSepherosa Ziehau  * SUCH DAMAGE.
33881f7bffSSepherosa Ziehau  */
34881f7bffSSepherosa Ziehau 
35881f7bffSSepherosa Ziehau #ifndef _DEV_DIMM_H_
36881f7bffSSepherosa Ziehau #define _DEV_DIMM_H_
37881f7bffSSepherosa Ziehau 
38881f7bffSSepherosa Ziehau struct dimm_softc;
39881f7bffSSepherosa Ziehau struct ksensor;
40881f7bffSSepherosa Ziehau 
41881f7bffSSepherosa Ziehau struct dimm_softc	*dimm_create(int _node, int _chan, int _slot);
42881f7bffSSepherosa Ziehau int			dimm_destroy(struct dimm_softc *_sc);
43881f7bffSSepherosa Ziehau void			dimm_sensor_attach(struct dimm_softc *_sc,
44881f7bffSSepherosa Ziehau 			    struct ksensor *_sens);
45881f7bffSSepherosa Ziehau void			dimm_sensor_detach(struct dimm_softc *_sc,
46881f7bffSSepherosa Ziehau 			    struct ksensor *_sens);
47881f7bffSSepherosa Ziehau 
48881f7bffSSepherosa Ziehau void			dimm_set_temp_thresh(struct dimm_softc *_sc,
49881f7bffSSepherosa Ziehau 			    int _hiwat, int _lowat);
507ee0de79SSepherosa Ziehau void			dimm_set_ecc_thresh(struct dimm_softc *_sc,
517ee0de79SSepherosa Ziehau 			    int _thresh);
527ee0de79SSepherosa Ziehau 
53881f7bffSSepherosa Ziehau void			dimm_sensor_temp(struct dimm_softc *_sc,
54881f7bffSSepherosa Ziehau 			    struct ksensor *_sens, int _temp);
5523832f75SSepherosa Ziehau void			dimm_sensor_ecc_set(struct dimm_softc *_sc,
5623832f75SSepherosa Ziehau 			    struct ksensor *_sens, int _ecc_cnt,
5723832f75SSepherosa Ziehau 			    boolean_t _crit);
58*e30371b4SSepherosa Ziehau void			dimm_sensor_ecc_add(struct dimm_softc *_sc,
59*e30371b4SSepherosa Ziehau 			    struct ksensor *_sens, int _ecc_cnt,
60*e30371b4SSepherosa Ziehau 			    boolean_t _crit);
61881f7bffSSepherosa Ziehau 
62881f7bffSSepherosa Ziehau #endif	/* !_DEV_DIMM_H_ */
63